Revision 7310ea6...

Go back to digest for 25th November 2012

Optimization in Development Tools

Milian Wolff committed changes in [kdevelop] /cpp:

Use union in PrimaryExpressionAST to reduce memory footprint.

On 64Bit machines, we had sizeof(PrimaryExpressionAST) == 64.
By using a union and enum this can be decreased to 40.

This can result in dramatically less memory consumption, esp. for
large qrc files e.g. In the case of the file attached to bug 291248
the memory consumption dropped by 200MB.

While the code handling is now a bit changed, I still think this
change is worth it. While at it, I've also refactored
ExpressionVisitor::visitPrimaryExpression. This gives us cleaner code
and should also be faster since we can use the token type instead of
doing string comparisons to find numbers.

File Changes

Modified 7 files
  • /cpp
  •   languagesduchain/expressionvisitor.cpp
  •   languagesduchain/expressionvisitor.h
  •   languagesduchain/usedecoratorvisitor.cpp
  •   languages/parser/ast.h
  •   languages/parser/codegenerator.cpp
  •   languages/parser/default_visitor.cpp
  •   languages/parser/parser.cpp
7 files changed in total