Skip to content

perf: lazy gc init for faster cold start#411

Merged
cs01 merged 1 commit intomainfrom
lazy-gc-init
Mar 16, 2026
Merged

perf: lazy gc init for faster cold start#411
cs01 merged 1 commit intomainfrom
lazy-gc-init

Conversation

@cs01
Copy link
Owner

@cs01 cs01 commented Mar 16, 2026

Summary

  • Removes explicit GC_init() call from main() — Boehm auto-initializes on first GC_malloc
  • Programs that never allocate GC memory (like hello world) skip GC init entirely
  • ~0.35ms faster cold start (13% improvement on hello world benchmark)

Test plan

  • npm run verify:quick passes
  • Before/after startup benchmark confirms improvement

improves cold start by ~0.35ms (13%) for hello world. boehm auto-initializes
on first GC_malloc so the explicit call was unnecessary overhead.
@cs01 cs01 merged commit 40251ac into main Mar 16, 2026
12 checks passed
@cs01 cs01 deleted the lazy-gc-init branch March 16, 2026 22:07
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.

1 participant