Review Request: Patch to reduce C++ memory consumption by removing DuContext* pointer from the AST

Alexander Dymo alexander.dymo at gmail.com
Mon Feb 15 17:14:53 UTC 2010


2010/2/15 Alexander Dymo <alexander.dymo at gmail.com>:
> C++ parser's AST base class has "KDevelop::DUContext* ducontext" pointer which isn't used for most of the nodes. For example, the primary expression AST nodes do not open a new context and if your file is big, the memory is wasted.
>
> This patch removes the context pointer from AST and instead fills a QMap<AST*, DuContext*> in the ParseSession class.
>
> For me and my huge files this saves ~50M of memory.
>
> Note, that the map will be ~2% slower than the pointer (when building uses for example).


David, what's your opinion on this? Is the gain in memory consumption
worth the loss in performance? I still haven't decided on this myself.




More information about the KDevelop-devel mailing list