Skip to content

Build: memory estimates from measured peaks (-14% compile), and a tip to close big programs - #165

Closed
RootChad wants to merge 1 commit into
mainfrom
build-speed-2
Closed

RootChad wants to merge 1 commit into
mainfrom
build-speed-2

Conversation

@RootChad

Copy link
Copy Markdown
Collaborator

What

  • nx2/build.py mem_need: measured again on a whole compile (i7-9700, 16 GB, clang 23.1.5), with each chunk's peak beside its estimate.
    • The 21 chunks with a function of 1 MB or more took twice the old estimate (code_016_2.c 1548 MB for 754, code_018.c 2779 for 2049). They outgrew what the gate kept for them, other compilers started, and the free memory fell to 48 MB, so Windows paged every compiler. They now get the old estimate ×1.4, and 1.6 GB at least; every one of them is at or over its peak.
    • The other chunks get 0.1 GB + 45 MB per MB of C + 450 MB per MB of the largest function. They peak at 350 MB on average; the new estimate is 501, the old one was 567. More of them fit beside the big ones.
  • Launcher, compile step: when less than 4 GB of memory is free and closable programs (browsers, Discord, Steam, Spotify…) hold 1 GB or more, a tip names them. For example: "Tip: closing Chrome, Discord and Steam frees 3.6 GB of memory, and the compile goes faster." It does not show for a small compile (an update of under 20 files).
  • build.py --only all: every game chunk and hot piece and nothing else, to measure the whole compile.

Measured

Same PC, same lifted code and profile, with a browser, Claude and Discord open (about 10 GB of 16), one run each:

before after
compile 2173 s 1877 s (-14%)
mean compilers running 4.5 5.2 (7.9 of 8 in the middle)

All 233 objects are the same byte for byte as before, apart from the COFF time stamp, hot pieces included. The game is unchanged and performance is untouched; only the order and number of compilers changes.

Not verified

  • Not run as a full install through the launcher.
  • The tip was not seen on screen. Its detection was run on the PC above: 963 MB free; Chrome 2.0 GB, Discord 1.0 GB, Steam 0.7 GB.
  • One run on each side: the memory other programs take varies, so the gain will vary from PC to PC.

🤖 Generated with Claude Code

…close big programs during the compile

- mem_need: measured again on a whole compile (i7-9700, 16 GB, clang 23.1.5), each chunk's peak beside its estimate. The 21
  chunks with a function of 1 MB or more took twice the old estimate (code_016_2.c 1548 MB for 754, code_018.c 2779 for
  2049): they outgrew what the gate kept for them, others started, and the free memory fell to 48 MB. They now get the old
  estimate x1.4 and 1.6 GB at least (every one at or over its peak); the other chunks 0.1 GB + 45 MB per MB of C + 450 MB per
  MB of the largest function (350 MB at their peak on average, 501 estimated, 567 before).
- The launcher's compile step names the big programs a player can close (browsers, Discord, Steam...) when the memory free is
  under 4 GB and they hold 1 GB or more: "closing Chrome, Discord and Steam frees 3.6 GB of memory, and the compile goes
  faster". Not for a small compile (an update of under 20 files).
- build.py --only all: every game chunk and hot piece and nothing else, to measure the whole compile.

Measured on the same PC, the same lifted code and profile, with a browser, Claude and Discord open: compile 2173 s -> 1877 s
(-14%, one run each); all 233 objects the same byte for byte as before but for the COFF time stamp, so the game is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pixl27

pixl27 commented Nov 22, 2026

Copy link
Copy Markdown
Owner

Merged into 0.7.9.3 (https://github.com/pixl27/ProjectReLink/releases/tag/v0.7.9.3), through the hotfix branch rather than this pull request, with your authorship kept in the commit (Co-authored-by). Thank you, RootChad.

@pixl27 pixl27 closed this Nov 22, 2026
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