bool -> Primitive casts#8621
Conversation
Signed-off-by: Mikhail Kot <mikhail@spiraldb.com>
806c947 to
39ce91b
Compare
Merging this PR will improve performance by 20.87%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | slice_empty_vortex |
339.4 ns | 397.8 ns | -14.66% |
| ⚡ | Simulation | chunked_bool_canonical_into[(1000, 10)] |
26.9 µs | 15.9 µs | +69.52% |
| ⚡ | Simulation | bitwise_not_vortex_buffer_mut[128] |
273.6 ns | 215.3 ns | +27.1% |
| ⚡ | Simulation | bitwise_not_vortex_buffer_mut[1024] |
333.9 ns | 275.6 ns | +21.17% |
| ⚡ | Simulation | bitwise_not_vortex_buffer_mut[2048] |
427.8 ns | 369.4 ns | +15.79% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing myrrc/bool-to-primitive-cast (39ce91b) with develop (00c39e8)
Footnotes
-
4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
| Ok(Some(match_each_native_ptype!(*new_ptype, |T| { | ||
| let (one, zero) = (<T as One>::one(), <T as Zero>::zero()); | ||
| let mut buffer = BufferMut::<T>::with_capacity(len); | ||
| buffer.extend(bits.iter().map(|v| if v { one } else { zero })); |
There was a problem hiding this comment.
Buffer::from_trusted_len_iter
|
I think these need to be separate |
Support of bool -> Primitive casts.
This is a subtask for pushing expressions of form
"WHERE prefix(...) > 0" to Duckdb.