#insertion #memory #set #compiler #insert #jit #batch

insertion-set

Performs a set of batched insertions on a vector

2 releases

0.1.1 Sep 27, 2024
0.1.0 Sep 27, 2024

#223 in Programming languages

Apache-2.0 OR MIT

23KB
335 lines

insertion-set

Crates.io Version docs.rs

Performs a set of batched insertions on a vector.

Vec::insert(index, value) takes O(n) time to move internal memory, so calling it in a loop can cause quadratic blowup.

If you batch multiple values together with an InsertionSet you can defer the expensive movement of the vector's memory till the of the loop.

This code was originally copied from the first prototype compiler for DuckLogic. It was inspired by the way the B3 JIT handles insertions.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Serde by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

No runtime deps