Skip to content

IC: reuse module symbols of re-exported modules - #26685

Merged
Araq merged 1 commit into
nim-lang:develfrom
nitely:ns_nif_spawn_fix1
Nov 11, 2026
Merged

Araq merged 1 commit into
nim-lang:develfrom
nitely:ns_nif_spawn_fix1

Conversation

@nitely

@nitely nitely commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

materializeReexportedModule created a new module symbol every time an interface referenced a re-exported module (import x; export x). Projects that re-export heavily, like nimbus, end up with thousands of copies per module. This caches them by module and name. icQualIfaces is replaced by a private icQualModules.

nimbus-eth2 beacon_chain/nimbus_beacon_node.nim, cold nim ic --parallelBuild:3:

Metric devel This PR
Wall time 20:16 16:02
Peak RSS 6.5 GB 1.6 GB
.s.bif size 919 MB 619 MB
All NIFs 2,123 MB 1,522 MB

Split from #26494

@nitely
nitely marked this pull request as ready for review November 11, 2026 03:34
@Araq
Araq merged commit 64d8f84 into nim-lang:devel Nov 11, 2026
19 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your hard work on this PR!
The lines below are statistics of the Nim compiler built from 64d8f84

Hint: codegen mm: orc; threads: on; opt: speed; options: -d:release
220689 lines; 10.036s; 640.832MiB peakmem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants