Rich-T-kid opened a new pull request, #11412:
URL: https://github.com/apache/arrow-rs/pull/11412

   # Which issue does this PR close?
   
   N/A — standalone benchmark addition.
   
   # Rationale for this change
   
   `arrow-cmp` has no benchmark coverage for its dictionary comparator path, so 
the cost of `make_comparator` on `DictionaryArray`s — and how (or whether) it 
scales with distinct value count — is not visible in CI or local perf runs. A 
dedicated bench makes it easy to track regressions and to measure follow-up 
optimisations.
   
   # What changes are included in this PR?
   
   - `arrow-cmp/benches/dict_cmp.rs` — new criterion benchmark. Builds 
`Dictionary<Int32, Utf8>` arrays with 1M rows at each of 8 cardinalities (`10, 
50, 100, 500, 750, 1000, 4000, 8192`), seeded for reproducibility. Each 
iteration constructs the comparator via `make_comparator` and invokes the 
returned closure 1M times on pseudo-random index pairs — the sort-style 
workload.
   - `arrow-cmp/Cargo.toml` — adds `criterion` and `rand` dev-dependencies and 
declares the `[[bench]] name = "dict_cmp"` entry.
   - `Cargo.lock` — resulting lockfile adjustments.
   
   # Are there any user-facing changes?
   
   No. Dev-only. No runtime or public-API changes.
   
   # How to run
   
   ```
   cargo bench -p arrow-cmp --bench dict_cmp
   ```
   
   Current baseline on `main` (median, 1M comparator calls per iteration):
   
   | Cardinality | Time |
   |-------------|-----:|
   | 10          | ~5 ms |
   | 50          | ~5 ms |
   | 100         | ~4 ms |
   | 500         | ~4 ms |
   | 750         | ~4 ms |
   | 1000        | ~4 ms |
   | 4000        | ~5 ms |
   | 8192        | ~6 ms |
   
   The cost is roughly flat (actually slightly growing with cardinality) 
because the per-call work is dominated by a boxed value-level comparator 
dispatch and a byte compare — independent of distinct value count. This bench 
will serve as the baseline for a follow-up optimisation PR.
   


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

Reply via email to