summaryrefslogtreecommitdiff
path: root/src/parser/parse-1-decls.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Parser][NFC] Split parser into multiple compilation units (#6653)Thomas Lively2024-06-121-0/+23
Because the parser has five stages, it requires instantiating all of the templates in parsers.h with up to five different contexts. Instantiating all those templates in a single compilation unit takes a long time. On my machine, a release build of wat-parser.cpp.o took 32 seconds. To reduce the time of incremental rebuilds on machines with many cores, split the code across several compilation units so that the templates need to be instantiated for just a single context in each unit. On my machine the longest compilation time after this splitting is 17 seconds. The time for a full release build also drops from 42 seconds to 33 seconds. On machines with fewer cores, the benefit may be smaller or even negative, though.