cpp_demangle icon indicating copy to clipboard operation
cpp_demangle copied to clipboard

Investigate performance improvements

Open fitzgen opened this issue 7 years ago • 0 comments

After #24, and we have some meaningful measures of performance, we should investigate improving those measures.

Filing this now so that I can jot down some ideas floating in the back of my head for posterity:

  • I can imagine some static optimizations that we apply as new passes over the AST after parsing or during parsing. Things like eagerly resolving substitutions table references, or what set of template args are in scope at what part of the AST.

  • Being more lazier about various things. Don't even bother determining which template args are (not) in scope if we aren't dealing with a symbol for some kind of template or has a templated parameter. Don't bother with leaf names if we didn't see any constructor or destructor when parsing. Etc.

  • Remove various uses of dynamic dispatch via trait objects. ArgScope and ArgScopeStack would be pretty easy to devirtualize into an enum. The DemangleAsInner stack would be harder (and result in such a large enum that it likely would not pay for itself).

fitzgen avatar Nov 29 '17 04:11 fitzgen