stojkomilos commented on PR #569: URL: https://github.com/apache/datasketches-cpp/pull/569#issuecomment-6901851169
> I merged master into this branch to resolve the conflicts with #558. The constructor no longer allocates; the first update or merge allocates the starting buffer of min(k, DEFAULT_K) items, which then grows by 8x up to k as before. `reserve()` now allocates the full k items, so a reserved sketch never grows. I kept the aliased-item tests from #573, changed the one lazy-growth check that expected an allocation at construction, and added tests for `reserve()`. @stojkomilos and @proost, please take a look, since this changed after the approval. LGTM. Please do note this behaviour, I don't know if it's intentional or not, decide if you want it - experiments show (and AI confirms in code): - `.reserve()` if called before the first update (when the buffer is empty), will allocate the full `k` items (so the buffer never grows) - However if you call `.reserve()` before the first update is called, it only allocates the `min(k, 200)`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
