Getting rid of global objects in kdevplatform/language

Milian Wolff mail at milianw.de
Fri May 14 09:00:44 UTC 2010


Andreas Pakulat, 14.05.2010:
> Hi,
> 
> so as this is now a _lot_ easier to manage (for me at least) with git I
> went ahead and replaced all objects that were created outside of any
> function in the language/ code with a function call creating a
> function-static object and returning a reference (or pointer where
> apropriate). No big problems there, I've published the branch
> (remove_duchain_static) for kdevplatform and kdevelop in my team-clones
> on gitorious.org (see the Repository clones list on
> http://gitorious.org/+kdevelop-developers/).  That way everybody can
> test the changes on his personal pet-project.
> 
> David said that this would severly reduce the parsing time, so obviously
> the next step was to check how much slower the code is now when parsing
> sources. I've taken the kdevplatform source dir and added the attached
> .kdev_include_paths file. I've built both kdevplatform and kdevelop in
> release mode and exported a dummy-session-id so I get a clean
> duchain-dir that I can easily delete. My "performance test" was this:
> 
> export KDEV_SESSION=duchainify
> rm -rf $HOME/.kdevduchain/duchainify
> time duchainify ---f all-declarations-and-uses-and-AST
> /home/andreas/src/kdevplatform
> 
> Which (to my knowledge) parses all sources of kdevplatform and included
> headers.
> 
> The results for the release mode are:
> with global/static objects (i.e. current master)
>         Run 1        Run 2        Run 3        Average
> real    1m40.875s    1m40.048s    1m40.119s    1m40.348s
> user    1m34.326s    1m33.210s    1m34.082s    1m33.873s
> sys     0m5.028s     0m4.924s     0m5.152s     0m5.026s
> 
> without global/static objects (i.e. remove_duchain_static branch)
> real    1m41.011s    1m42.709s    1m42.222s    1m41.980s
> user    1m34.934s    1m37.002s    1m35.546s    1m35.830s
> sys     0m4.652s     0m5.084s     0m5.212s     0m4.983s
> 
> If somebody finds a flaw in this (not very scientific) performance test
> please tell me and I'll be happy to improve it.
> 
> With these numbers I'd like to merge the branch into master which will
> allow for a couple of nice improvements:
> 
> - the QFSFileEngine::map() warning is gone, which might help with some
>   of the crash-reports we have (as some are related to mmap-stuff)
> - No .bin binary anymore, just a single kdevelop executable
> - no environment variable needed anymore
> - The inline-code in the sessioncontroller, that is also partly copied
>   can be made non-inline again
> - We can move the duchain-data into the session-directory as we can use
>   KDE API in the repositories
> - portability to other platforms, this stems from other platforms
>   possibly having other initialization orders
> - probably more stuff I can't remember right now
> 
> Opinions?

I'm all for it
-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20100514/26c8506d/attachment.sig>


More information about the KDevelop-devel mailing list