The compiler, measured on itself
For new readers
PatLang's compiler is itself written in PatLang (see the journey page for how that came about) โ this short page is literally that compiler timing itself while compiling its own ~290,000-character source file, split into its four stages (tokenize, parse, lower, generate code). Useful mainly as a concrete performance data point, not something you need background to read.
The self-hosted compiler front+middle end processing its own complete source (289918 chars), run under the Stage 0 interpreter while building this page:
- tokenize: 52197 tokens in 4470 ms
- parse: 102 top-level statements in 1350 ms
- lower: 101 functions in 10778 ms
- codegen: 1622189 chars of Rust in 7828 ms
The natively compiled compiler (patc1) runs the same front end roughly two orders of magnitude faster; rustc then dominates end-to-end compile time.