Skip to content

perf(coro): allocate panic snapshots lazily - #156

Merged
cpunion merged 1 commit into
llvm-corofrom
coro/lazy-panic-store-20260811
Aug 11, 2026
Merged

perf(coro): allocate panic snapshots lazily#156
cpunion merged 1 commit into
llvm-corofrom
coro/lazy-panic-store-20260811

Conversation

@cpunion

@cpunion cpunion commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Move the bounded 64-PC panic snapshot out of every runtime G and allocate it only when a managed snapshot is requested. Stackless language panics retain their scheduler-owned logical trace and pay no allocation.

The legacy SA_SIGINFO path remains allocation-free: it reuses an existing G-owned store or a static emergency store matching the already process-global fault-source semantics. Lifecycle paths release owned stores, and a source gate prevents the signal callback from reaching the allocating entry.

Measured at 10,000 parked Gs with GOMAXPROCS=1:

  • parent c773ea5: 40,779,776 bytes RSS
  • candidate: 32,751,616 bytes RSS (-19.7%)
  • Go gc: 31,539,200 bytes RSS
  • candidate incremental slope: 2,502 bytes/G vs Go 2,798 bytes/G

Validation:

  • cd runtime && go test ./...
  • go test ./cl -run TestCoro(ExplicitStatusRecoverIRNativeAndWasm32|ExplicitStatusPanicNativeAndWasm32)$ -count=1
  • go test ./internal/build -run TestCoroExplicitPanicNativeNoStdlibRuntimeE2E -count=1
  • native core workload build/run at 0, 1k, 5k, and 10k parked Gs
  • WASI core workload build and Wasmtime execution

The legacy PCLN signal integration command is blocked before its selected subtest by the same existing pclntab_external.go uintptr-retention audit on both this branch and exact parent c773ea5.

@cpunion
cpunion merged commit a3e1a09 into llvm-coro Aug 11, 2026
17 checks passed
@cpunion
cpunion deleted the coro/lazy-panic-store-20260811 branch August 11, 2026 10:10
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