perf: reduce compiler allocation overhead and close the JIT gap - #515
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sync.Poollookups from hot AST constructors and embed base nodes in high-volume AST typesdefault()guard sentinelCompileAPI and update the benchmark documentationGOGC=200as an opt-in throughput setting rather than changing the process-wide runtime from the libraryPerformance
Measured on Apple M1 Max, Go 1.24.5, Node.js 24.4.1, 212 benchmark files:
BenchmarkLargeSuitemedianGOGC=200The retained code changes improve the core Go suite by about 19.5%. Realistic fresh-process builds are 1.8x faster than Less.js. Peak-JIT isolated-file performance remains about 18% ahead of default Go, while
GOGC=200moves the aggregate warmed Go suite slightly ahead with a larger heap target.GC trace sampling over 15 builds:
GOGC=100GOGC=200GOGC=400Investigation notes
Several ideas were measured and reverted rather than included:
Unitallocation and combinator trimming changes had no reproducible effectValidation
go test ./...go test -race ./less -run='TestCompile|TestFactory|TestIntegrationSuite/main/functions|TestFunctionRegistry' -count=1go run scripts/test.go integration— repository baseline 316/317, one existing compile failure, zero output differencesnode scripts/bench-compare.jsnode scripts/bench-compare-suite.js