improving rxx_allocator

floris flo.ruijt at gmail.com
Thu Feb 24 02:11:48 UTC 2011


On Thu, 2011-02-24 at 02:04 +0100, Aleix Pol wrote: 
> On Thu, Feb 24, 2011 at 12:14 AM, floris <flo.ruijt at gmail.com> wrote:
>         I've looked into rxx_allocator. At first I had some issues
>         profiling it,
>         as it were inlined (Valgrind should learn how to profile that
>         anyway).
>         
>         the previous allocator was not very good. it used a realloc'd
>         array of
>         pointers to blocks, which would be deleted in the destructor.
>         
>         my allocator uses a linked list of blocks, which are put in a
>         static
>         linked list at the destructor. it uses a QMutex to make sure
>         that no two
>         threads try to pull the same block.
>         
>         
>         the other part of this patch are the removal of useless
>         includes of
>         memorypool.h (which made large parts of kdevelop recompile on
>         every edit
>         to the allocator) and templating listnode on pool so that it
>         doesn't
>         need the memorypool.h header in it's own.
>         
>         --
>         KDevelop-devel mailing list
>         KDevelop-devel at kdevelop.org
>         https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
>         
> 
> Sounds like a not-so-straightforward optimization.
> Is it really faster? what is the improvement using duchainify?
> 
> 
> Aleix

i measured it with
duchainify --force-update-recursive /languages/cpp/

here are the results:

pure master:
real 5m23.922s
user 1m47.359s
sys 0m15.933s


improved allocator:
real 4m46.738s
user 1m30.742s
sys 0m15.777s


or it is about 11% faster

Floris





More information about the KDevelop-devel mailing list