The compiler, measured on itself

The self-hosted compiler front+middle end processing its own complete source (607481 chars), run under the Stage 0 interpreter while building this page:

  • tokenize: 86912 tokens in 21108 ms
  • parse: 158 top-level statements in 690 ms
  • lower: 156 functions in 645 ms
  • codegen: 3014781 chars of Rust in 599 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.