Performance comparison between BWArr and Google BTree data structures across various operations.
Test Environment:
- Go 1.25.5
- BTree degree: 32
- Dataset sizes: 100K, 250K, 500K, 1M, 2M, 4M elements
- Random values: Full int64 range (math.MaxInt64)
Measures the time to insert N unique random int64 values into an empty data structure. Both BWArr and BTree start empty and insert all values one by one.
What's measured:
- Time per operation (milliseconds)
- Number of allocations per operation
- Bytes allocated per operation
Setup: Fresh empty data structure created for each iteration
Measures the time to look up N values by their keys in a pre-populated data structure. The data structure is populated with all values before timing starts, then each value is retrieved by key.
What's measured:
- Time per operation (milliseconds)
Setup: Data structure pre-populated with all values, timing excludes setup
Measures the time to iterate through all N values in sorted order. The data structure is pre-populated, and iteration yields values in ascending order.
What's measured:
- Time per operation (milliseconds)
Setup: Data structure pre-populated with all values
Measures the time to iterate through all N values without ordering guarantees. BWArr can iterate in insertion order or unordered for better performance.
What's measured:
- Time per operation (milliseconds)
Setup: Data structure pre-populated with all values
Measures the time to delete N values from a pre-populated data structure. Each value is deleted one by one.
What's measured:
- Time per operation (milliseconds)
Setup: Data structure pre-populated with all values, timing excludes setup
To regenerate these graphs:
make runGraphs are automatically saved to the images/ directory.
To run standard Go benchmarks:
make bench # Full benchmarks (10s each)
make bench-quick # Quick benchmarks (1s each)





