diff --git a/src/main.rs b/src/main.rs index f0cfff2..e3435f7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -29,9 +29,17 @@ pub struct Blob { // where n is number of bytes // and m is number of ranges // ------------------------- + // Selected VecDeque>> for fast push/pop/access + // pop_front may re-allocate, but better than vector most of time + // also since we use box, we are only copying pointers to the arrays, not each u8 + // ------------------------- // also tried using LinkedList, but slow reading when ranges were inside nodes // and indexing into LinkedList nodes doesn't seem to jive well with Rust's ownership model // especially when considering multi-threaded access + // ------------------------- + // Vec>> also worth considering, but instead of pop + // using None slots to maintain indexes, if arrays are likely to be sparse + // this would probably be preferrable arrays: VecDeque>, // complexity variable n dropped: usize, ranges: Vec, // valid, global // complexity variable m