Files
Nim/compiler
araq 39b2f1830f IC: break down processTopLevel, and refute the obvious frontend win
The frontend's loading is 3.55s of Atlas's 9.2s and had no breakdown
finer than "TopLevel 1459ms". Now it does — `tTopReplay`, `tTopLogOps`,
`tTopOffers`, `tTopStmts` and a counter for the records the loader
skips:

    TopLevel 1459ms = Offers 569 + ExportBranch 312 + LogOps 137
                      + the bare cursor walk ~371 + Replay/Stmts ~11

That immediately suggests a target, and it is a trap. 80% of every
module header the loader walks is tooling-only records — `sig`, one per
signature-symbol occurrence, plus `expansion`/`modulesrc` — which it
skips on sight and which exist only for `idetools`: 3.36M of 4.19M nodes
on Atlas. Grouping them under one tag, or moving them past the
`(implementation)` marker where the loop stops, is an easy change and
buys nothing.

Probed before building any of it, by emitting none of them at all:

    nodes walked  4.19M -> 0.85M      .s.bif    44.7MB -> 44.0MB
    TopLevel      1459ms -> 1406ms    frontend  9.29s  -> 9.18s

Walking 3.3M records costs 53ms. `skip` on a `TagLit` is a jump, not a
scan — about 16ns a node — so the count was never the cost. A format
change for 0.5% would have been a bad trade discovered late.

What is left is the per-process re-load itself: 180 `nim m` each parsing
~20 modules' interfaces out of 44.7MB of `.s.bif`, with no dominant item
because there is no single item. It is the amortisation problem batching
already solved for the backend (`loadDepClosure` 10.2s -> 1.3s), and the
frontend is where it has not been solved.

Behind `-d:icBNodeProf`. ic 42/42, `koch boot -d:release` equal
executables.
2026-08-31 20:30:36 +02:00
..
2026-06-11 14:10:42 +02:00
2026-02-10 13:21:35 +01:00
2026-06-25 23:20:34 +02:00
2026-08-27 19:35:11 +02:00
2017-01-07 22:35:09 +01:00
2026-08-17 15:02:49 +02:00
2026-08-17 15:02:49 +02:00
2025-12-11 18:22:38 +01:00
2025-12-11 18:22:38 +01:00
2026-08-27 19:35:11 +02:00
2026-07-03 15:52:41 +02:00
2026-07-04 10:13:39 +02:00
2025-11-25 12:49:23 +01:00
2026-08-17 15:02:49 +02:00
2024-12-27 19:42:18 +01:00
2026-06-14 22:35:06 +02:00
2026-08-17 15:02:49 +02:00
2025-12-11 18:22:38 +01:00
2026-04-02 07:19:43 +02:00
2026-06-14 22:35:06 +02:00
2026-06-25 23:20:34 +02:00
2021-01-12 09:36:51 +01:00
2026-01-09 13:10:04 +01:00
2026-06-14 22:35:06 +02:00
2026-08-17 15:02:49 +02:00
2026-07-03 15:52:41 +02:00
2026-08-27 19:35:11 +02:00
2026-06-24 21:58:51 +02:00
2025-12-11 18:22:38 +01:00
2026-08-17 15:02:49 +02:00
2026-06-14 22:35:06 +02:00
2026-08-17 15:02:49 +02:00
2026-02-10 13:21:35 +01:00
2026-08-17 15:02:49 +02:00
2023-07-02 22:36:05 +02:00
2026-08-17 15:02:49 +02:00
2026-08-17 15:02:49 +02:00
2026-08-17 15:02:49 +02:00
2026-08-11 22:27:49 +02:00
2025-12-11 18:22:38 +01:00
2026-08-17 15:02:49 +02:00
2025-12-11 18:22:38 +01:00
2026-08-27 19:35:11 +02:00
2026-08-17 15:02:49 +02:00
2025-12-11 18:22:38 +01:00
2026-08-17 15:02:49 +02:00
2026-08-17 15:02:49 +02:00
2026-08-17 15:02:49 +02:00
2026-06-24 21:58:51 +02:00
2026-08-17 15:02:49 +02:00
2026-08-17 15:02:49 +02:00
2026-08-17 15:02:49 +02:00
2026-08-17 15:02:49 +02:00
2023-12-25 07:12:54 +01:00

Nim Compiler

  • This directory contains the Nim compiler written in Nim.
  • Note that this code has been translated from a bootstrapping version written in Pascal.
  • So the code is not a poster child of good Nim code.

See Internals of the Nim Compiler for more information.