1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2026-01-21 01:31:01 +00:00
serenity/Userland/Libraries/LibCpp
Itamar 42eb06f045 LibCpp: Don't store entire ASTNode vector in each parser state
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.
2021-07-13 23:20:09 +02:00
..
Tests
AST.cpp
AST.h
CMakeLists.txt
Lexer.cpp
Lexer.h
Parser.cpp LibCpp: Don't store entire ASTNode vector in each parser state 2021-07-13 23:20:09 +02:00
Parser.h LibCpp: Don't store entire ASTNode vector in each parser state 2021-07-13 23:20:09 +02:00
Preprocessor.cpp
Preprocessor.h
SyntaxHighlighter.cpp
SyntaxHighlighter.h
Token.cpp
Token.h