Fwd: Review Request: Patch to reduce C++ parser memory consumption by removing parent AST pointer from AST nodes

Alexander Dymo alexander.dymo at gmail.com
Mon Feb 15 14:06:38 UTC 2010


---------- Forwarded message ----------
From: Alexander Dymo <alexander.dymo at gmail.com>
Date: 2010/2/15
Subject: Review Request: Patch to reduce C++ parser memory consumption
by removing parent AST pointer from AST nodes
To: David Nolden <zwabel+reviewboard at gmail.com>, Bertjan Broeksema
<b.broeksema at home.nl>
Копія: Alexander Dymo <alexander.dymo at gmail.com>, KDevelop
<kdevelop-devel at kdevelop.org>



-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/2940/
-----------------------------------------------------------

Review request for KDevelop, Bertjan Broeksema and David Nolden.


Summary
-------

We currently have AST *parent pointer in every AST node and it's never
used in our code (I mean the release-ready code). Bertjan, I know
that's something you wanted for your work, but maybe you can implement
another way of storing parents (a map perhaps?). This unused pointer
increases the size of AST and I'd like to avoid things like that as
much as possible.

For my large C file, the peak memory consumption is reduced from 703M
to 655M (-48M) by removing the parent pointer.


Diffs
-----

 /trunk/extragear/sdk/kdevelop/languages/cpp/cppparsejob.cpp 1090158
 /trunk/extragear/sdk/kdevelop/languages/cpp/parser/CMakeLists.txt 1090158
 /trunk/extragear/sdk/kdevelop/languages/cpp/parser/parentvisitor.h 1090158
 /trunk/extragear/sdk/kdevelop/languages/cpp/parser/parentvisitor.cpp 1090158
 /trunk/extragear/sdk/kdevelop/languages/cpp/parser/parsesession.h 1090158
 /trunk/extragear/sdk/kdevelop/languages/cpp/parser/parsesession.cpp 1090158

Diff: http://reviewboard.kde.org/r/2940/diff


Testing
-------

All tests pass.


Thanks,

Alexander




More information about the KDevelop-devel mailing list