Latest Results
perf(array): drop the TypeId downcast from Array::data_mut
`data_mut` reached its own encoding data through `as_any_mut().downcast_mut()`,
spending a virtual call and a `TypeId` comparison to learn what `Array<V>`
already guarantees. The shared path beside it, `downcast_inner`, does not: it
asserts the invariant in debug and casts. This makes the two consistent.
The executor pays this once per chunk, through
`Chunked::execute` -> `with_next_builder_slot`, which threads the builder slot
counter through the array itself. Callgrind over a 32-chunk FSL canonicalize
attributed 1,977 instructions per execution to that function, a third of them
in `core::any`. It is now 1,417, and the whole canonicalize drops from 41,071
instructions to 40,314.
`as_any_mut` had no other callers, so `DynArrayData` loses it.
Wall clock on `chunked_fsl_canonicalize` at list size 1024, medians of three
runs, against the pre-optimization baseline measured in the same conditions:
chunks before after
2 1.796 us 1.227 us -32%
8 3.219 us 1.989 us -38%
32 8.612 us 4.999 us -42%
Signed-off-by: Robert Kruszewski <robert@spiraldb.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZTu9XUrdRZZ91rx852DGfclaude/chunked-canonical-via-builder-9ze0t6 Latest Branches
+13%
+2%
+7%
claude/vibrant-hawking-jl94oh © 2026 CodSpeed Technology