You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ffaec9f
Browse filesBrowse the repository at this point in the historyBrowse files
Build arrays through non-generic constructors (#10737)
The generic constructors (`ConstantArray::new<S>`,
`PrimitiveArray::{new, try_new, new_unchecked, empty}<T>`,
`DecimalArray::{try_new, new_unchecked}<T>`, and the `impl IntoIterator`
constructors of `StructArray` and `ChunkedArray`) called the generic
`Array::from_parts_unchecked` and `Array::try_from_parts` directly. Each
crate that called them monomorphized its own copy of those functions and
of the full `DynArrayData` vtable for the encoding.
The generic constructors now call a private, non-generic builder.
`vortex-array` compiles each vtable once, and other crates call it.
`ScalarFn` had the same problem because `new_from_validated_slots` was
`#[inline]`, and it is not inlined now. The cost is one function call
when an array is constructed.
| `vortex-ffi` release cdylib (macOS arm64) | before | after |
|---|---|---|
| `__text` | 37,223,740 B | 36,613,308 B (-610 KB) |
| Copies of the vtable: Constant / Primitive / Struct / Chunked /
Decimal / ScalarFn | 22 / 17 / 7 / 5 / 5 / 4 | 1 / 1 / 1 / 1 / 1 / 1 |
Signed-off-by: Robert Kruszewski <robert@spiraldb.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments