feat: add binary_trees_gc benchmark that explicitly invokes System.gc
Add a new benchmark variant of the binary_trees test that calls System.gc() after each tree construction phase to measure garbage collection overhead. The benchmark creates a stretch tree, a long-lived tree, and iterates through depths 4 to 12 with explicit GC calls between iterations. Register the new benchmark in util/benchmark.py with expected output values matching the original binary_trees benchmark.
This commit is contained in:
@@ -59,6 +59,14 @@ BENCHMARK("binary_trees", """stretch tree of depth 13 check: -1
|
||||
32 trees of depth 12 check: -32
|
||||
long lived tree of depth 12 check: -1""")
|
||||
|
||||
BENCHMARK("binary_trees_gc", """stretch tree of depth 13 check: -1
|
||||
8192 trees of depth 4 check: -8192
|
||||
2048 trees of depth 6 check: -2048
|
||||
512 trees of depth 8 check: -512
|
||||
128 trees of depth 10 check: -128
|
||||
32 trees of depth 12 check: -32
|
||||
long lived tree of depth 12 check: -1""")
|
||||
|
||||
BENCHMARK("delta_blue", "14065400")
|
||||
|
||||
BENCHMARK("fib", r"""317811
|
||||
|
||||
Reference in New Issue
Block a user