mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
42eb06f045
We previously stored the entire ASTNode vector in each parser state, and this vector was copied whenever a state was loaded or saved. We don't actually need to store the whole nodes list in each state because a new state can only add new nodes to this list, and won't mutate existing nodes. It would suffice to only hold a vector of the nodes that were created while parsing in the current state to keep a reference to them. This reduces the time it takes on my machine for the c++ language server to handle a file that #includes <LibGUI/Widget.h> from ~4sec to ~0.7sec. |
||
---|---|---|
.. | ||
Tests | ||
AST.cpp | ||
AST.h | ||
CMakeLists.txt | ||
Lexer.cpp | ||
Lexer.h | ||
Parser.cpp | ||
Parser.h | ||
Preprocessor.cpp | ||
Preprocessor.h | ||
SyntaxHighlighter.cpp | ||
SyntaxHighlighter.h | ||
Token.cpp | ||
Token.h |