Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
util/interval/generic: avoid new allocations in btree benchmarks
The generic template for interval btree makes an attempt to work with both value and pointer parameterized types. To facilitate this option in tests, it used reflection to create new instances of the item type. This reflection was preventing allocations of the item type from being inlined and avoided by escape analysis, which was skewing benchmarks. This commit fixes this by avoiding the reflection and instead adding a constructor to the contract of the parameterized type. This is cleaner and allows the allocations to be avoided in these benchmarks.
- Loading branch information