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 15:15:36 UTC 2010



> On 2010-02-15 15:00:24, Bertjan Broeksema wrote:
> > Alexander, do you mind to create a patch which brings back this functionality after removal? I'm currently writing my thesis and don't have enough time to adapt my code to have the parent nodes stored in a different way. Obviously I'd like to show something when I have to defend my thesis in ~1 month. Otherwise, please send me an e-mail with the revision containing the removal so that I can set that as the maximum supported rev for my plugin. 
> > 
> > Preferably the first. Millian will start his internship at KDAB soon and he'll be most likely continuing my work. So maybe we can do a release of the plugin afterwards. Currently its not in a state yet that I want to release it.
> > 
> > Cheers,
> > 
> > Bertjan

Yeah, I can send you a patch. Btw, is your plugin somewhere in svn? I could probably do the porting for you.


- Alexander


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


On 2010-02-15 14:04:31, Alexander Dymo wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/2940/
> -----------------------------------------------------------
> 
> (Updated 2010-02-15 14:04:31)
> 
> 
> 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