Revision 569772
Go back to digest for 6th August 2006Optimization in Development Tools
Optimize project loading, document loading, and background parser.
1. Introduce caching mechanism in the background parser and codeproxy. This allows us to perform an expensive operation only after a number of files have been parsed rather than for every file.
2. Part creation now caches the KParts::Factory(s) so we don't use KLibLoader for every creation of a document.
3. Change KDevDocument so that we cache information like the mimetype rather than looking it up by url every time.
4. Change the way we load KTextEditor documents at startup. Basically, KParts::openURL is expensive so we don't do that at startup. Instead this is done when the doc first becomes active. Will revisit this if it is too much of a delay for the user.
5. For the time being load every project file into the backgroundparser at startup. Use
this to test for other machines. I want to see how long it takes.
Some marks:
With these optimizations I can load 1268 files (every c++ src/header file in kdevelop project) at startup as open documents in under two minutes. Each file is parsed and a codemodel is computed. Each file has a KTextEditor part created for it. And it takes about %32 of active memory once it is done.
With no open documents at startup, I can still parse every file, all 1268, at startup in under 1 minute.
That's pretty fast.
Congratulations to Roberto and everyone else.
File Changes
- /trunk/KDE/kdevelop
- /lib/kdevbackgroundparser.cpp
- /lib/kdevbackgroundparser.h
- /lib/kdevcodeaggregate.cpp
- /lib/kdevcodeaggregate_p.h
- /lib/kdevcodeproxy.cpp
- /lib/kdevcodeproxy.h
- /lib/kdevdocument.cpp
- /lib/kdevdocument.h
- /lib/kdevdocumentcontroller.cpp
- /lib/kdevdocumentcontroller.h
- /lib/kdevlanguagesupport.cpp
- /lib/kdevpartcontroller.cpp
- /lib/kdevpartcontroller.h
- /lib/kdevprojectcontroller.cpp
- /languages/cpp/cpplanguagesupport.cpp
- /plugins/documentview/kdevdocumentview_part.cpp