davecromberge opened a new pull request, #344:
URL: https://github.com/apache/datasketches-rust/pull/344

   Speeds up `ThetaSketch::compact` by gathering retained hashes without a 
per-slot branch and bucket-sorting them for ordered output; the compact bytes 
are unchanged.
   
   - Hashes are uniform below theta, so a counting pass on their top bits 
followed by insertion sort replaces `sort_unstable`; a bucket over 32 entries 
or fewer than 256 hashes falls back to `sort_unstable`.
   - Tables at most 1/16 full keep the simple loop, so tiny sketches are not 
slower.
   
   Speedup vs `main` from the characterization `theta_compact_serde_profile` 
job (lg_k 12; geometric mean over each band, best of 3 interleaved passes):
   
   | TrueU | `compact(true)` | `compact(false)` |
   |---|---|---|
   | 1–64 | 1.67× | 3.1× |
   | 65–4,096 | 2.1× | 5.8× |
   | 4,097–1,048,576 | 1.70× | 3.9× |
   
   Ordered speedup split between the two parts (separate interleaved run 
including a gather-only build):
   
   | TrueU | Gather only | Gather + bucket sort |
   |---|---|---|
   | 1–64 | 1.63× | 1.59× |
   | 65–4,096 | 1.62× | 2.01× |
   | 4,097–1,048,576 | 1.28× | 1.67× |
   
   Unordered compaction gets its whole gain from the gather.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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]

Reply via email to