Conversation
MBkkt
commented
Jan 11, 2023
* Add ability to reuse term buffer * Add option for optimize index size if query only points
| auto const count = state.range(0); | ||
| for (auto _ : state) { | ||
| for (int64_t i = 0; i < count; ++i) { | ||
| auto value = indexer.GetIndexTerms(S2Testing::RandomPoint(), {}); |
There was a problem hiding this comment.
You're only testing the S2Point overload. Is that the only one you care about?
For that one, you can easily exactly compute the size you need and reserve it. I will add this and include it in the next PR.
What are the numbers when you do that?
There was a problem hiding this comment.
I wrote answer in other PR.
Benchmarks became same if you make reserve, not because reserve make same it still N allocations instead of 1.
But because it's microbenchmark, and opposite to real code allocator has not other work
You're only testing the S2Point overload.
Not, but it's pretty same if we have covering (I added overload only for such functions)
There was a problem hiding this comment.
Why is so much resistance about this?
I don't think it's needed for other API, like java or golang, because they care about performance a more little than cpp code