mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-07 17:15:26 +00:00
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.