Jack be nimble. Jack be quick.
JackVec is a native, performance-focused descendant of
Mozilla's thin-vec crate. ThinVec's
one-word vector design stores its length and capacity in the allocation rather
than in the collection value, reducing the footprint of empty-heavy and deeply
nested data structures.
This project builds directly on the design and implementation work of ThinVec's
original authors and Mozilla contributors. Its Cargo package, Rust crate path,
primary type, and construction macro are jack-vec, jack_vec, JackVec, and
jack_vec!.
JackVec retains the one-word owner and shared allocation-free empty singleton.
Its eight-byte allocation header stores length and capacity as u32; the actual
maximum capacity may be lower when element layout or isize limits require it.
It targets native Rust rather than Gecko/nsTArray FFI.
JackVec is not yet published on crates.io. Until its first release, depend on the Git repository (and pin a reviewed revision in reproducible applications):
[dependencies]
jack-vec = { git = "https://github.com/moderately-ai/jack-vec" }use jack_vec::{jack_vec, JackVec};
let values: JackVec<_> = jack_vec![1, 2, 3];
assert_eq!(values.as_slice(), &[1, 2, 3]);See benches/README.md for focused JackVec regression
benchmarks. The non-published comparisons workspace
crate provides the reproducible Vec, JackVec, upstream ThinVec,
SmallVec4, and SmallVec8 CPU and memory matrix tracked by CodSpeed and the
controlled macOS/Linux protocol.
JackVec is derived from ThinVec and retains its MIT OR Apache-2.0 licensing. Copyright and authorship credit for the original design and implementation belongs to ThinVec's authors and Mozilla contributors; JackVec's history and release notes preserve that provenance explicitly.