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

David Nolden zwabel at googlemail.com
Mon Feb 15 17:45:15 UTC 2010


Am Montag 15 Februar 2010 18:24:16 schrieb Alexander Dymo:
> 2010/2/15 David Nolden <zwabel at googlemail.com>:
> > Hmm but where does the performance loss come from? Normally we don't
> > store the AST, and in such a case we also shouldn't build the parent-map,
> > so it should not affect our normal usage.
> 
> No, that's not about parent pointer, that's about another pointer -
> DuContext* pointer in AST class. If we don't store it there and use a
> map, we have a 2% performance loss.

Ah, looks like I didn't read the title correctly. :-)

Well I was also thinking about doing something like this at some point, but it 
definitely isn't worth 2% performance loss I think.

Although it might be faster if you use a google::sparse_hash (see its usage in 
duchain.cpp) instead of QMap.

Greetings, David




More information about the KDevelop-devel mailing list