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

Christoph Bartoschek bartoschek at or.uni-bonn.de
Mon Feb 15 23:18:41 UTC 2010


Am Montag 15 Februar 2010 23:25 schrieb Alexander Dymo:
> 2010/2/15 David Nolden <zwabel at googlemail.com>:
> > Although it might be faster if you use a google::sparse_hash (see its
> > usage in duchain.cpp) instead of QMap.
>
> I tried the dense_hash_map (which should IIRC be the fastest one) with
> a simple hash object which just casts AST* pointer to the size_t. It
> didn't improve the performance:
>
> declaration and use building for kdevelop project:
> pointer:		41.77
> QMap:		42.55
> dense_hash:	42.52
>
> So, I'd say that I'll not apply this patch.

Which benchmark did you use? It you only measure the AST * access? Normally 
memory savings also give speed increases. But they are in different areas.  
The whole picture has to be measured.

If you are trying different implementations you should also consider judy 
trees: judy.sf.net

A map should be the slowest as it uses a balanced tree.

Christoph




More information about the KDevelop-devel mailing list