cpp_demangle
cpp_demangle copied to clipboard
Investigate performance improvements
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.
ArgScopeandArgScopeStackwould be pretty easy to devirtualize into anenum. TheDemangleAsInnerstack would be harder (and result in such a large enum that it likely would not pay for itself).