Organize benchmarks using the `BenchmarkGroup` type
mainA BenchmarkGroup acts as an organizational unit for benchmark suites. It can store and structure benchmark definitions (@benchmarkable), raw Trial data, estimation results, and nested BenchmarkGroup instances. It supports a subset of the Julia AbstractDict interface, allowing you to map IDs to values and assign descriptive "tags" for filtering.
Defining a suite
You can create a hierarchy by indexing into a BenchmarkGroup. Keys are automatically created upon access, even if they do not exist. To remove unused keys created by accidental access, use clear_empty!(suite).
# Define a parent group
suite = BenchmarkGroup()
# Add child groups with tags for filtering
suite["utf8"] = BenchmarkGroup(["string", "unicode"])
suite["trig"] = BenchmarkGroup(["math", "triangles"])
# Add benchmarks to a specific group
teststr = join(rand('a':'d', 10^4))
suite["utf8"]["replace"] = @benchmarkable replace($teststr, "a" => "b")
# Nested creation via indexing
suite2 = BenchmarkGroup()
suite2["my"]["nested"]["benchmark"] = @benchmarkable sum(randn(32))