Add ast_churn: port of Go's garbage benchmark - #103
Open
gbaraldi wants to merge 1 commit into
Open
Conversation
Repeatedly parse Julia source from Base with Meta.parseall on 2*nthreads
concurrent tasks, keeping a rotating window of parsed ASTs alive so half the
window behaves as an old generation. This is a port of Go's `garbage`
benchmark (golang/benchmarks/garbage), the workload used to motivate the
Green Tea collector.
Unlike the binary-tree benchmarks, an AST is a graph of many different small
types (Expr, Symbol, LineNumberNode, Vector{Any}), so the mark phase cannot
assume neighbouring objects share a layout - a heterogeneous-heap stress test
the suite currently lacks. On a Zen 4 machine with 4 threads it runs ~9s with
~22% of time in GC.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
oscardssmith
approved these changes
Aug 4, 2026
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.
Port of Go's
garbagebenchmark (golang/benchmarksgarbage/garbage.go), the GC-heavy workload used to motivate the Green Tea collector.2 * nthreadstasks repeatedly parse ~10 files of Base source withMeta.parseall, keeping a rotating window of 64 parsed ASTs alive; only the first half of the window is overwritten, so the second half behaves as an old generation (as in the Go original).Why it earns a slot in the suite: an AST is a deep pointer graph of many different small types (
Expr,Symbol,LineNumberNode,Vector{Any}, literals), so the mark phase cannot assume neighbouring objects share a layout. That heterogeneous-heap profile is what package loading and tooling workloads look like, and no current benchmark has it — the binary-tree and array benches are homogeneous. While characterizing mark-phase experiments on julia master we found this workload consistently responds differently from every synthetic benchmark in the suite, which is exactly why it's worth tracking.Measured on Julia 1.12.6, 4 threads (Zen 4): ~9 s, ~6 GB allocated, ~22% of time in GC.
Disclosure: this PR was written with the assistance of generative AI (Claude).
🤖 Generated with Claude Code