Crates.io | insertion-set |
lib.rs | insertion-set |
version | 0.1.1 |
source | src |
created_at | 2024-09-27 06:39:56.365957 |
updated_at | 2024-09-27 14:29:33.221309 |
description | Performs a set of batched insertions on a vector |
homepage | |
repository | https://github.com/Techcable/insertion-set.rust |
max_upload_size | |
id | 1388332 |
size | 34,731 |
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.
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.