Skip to content

12.0.0

Compare
Choose a tag to compare
@bodil bodil released this 30 Aug 15:32
· 234 commits to master since this release
12.0.0

Starting with this release, the arc flag is gone, in favour of publishing im as two separate crates: im (using Arc) and im-rc (using Rc). They're identical (and built from the same code), except that im is thread safe and im-rc is a little bit more performant.

This is a major release as a consequence, but there should be no breaking code changes other than the new default choice of reference counter.

Added

  • The Chunk datatype that's used to build Vector and OrdMap has been exposed and made generally usable. It's somewhere between a GenericArray and a ring buffer, offers O(1)* push in either direction, and is generally hyperoptimised for its purpose of serving as nodes for Bagwell tries, but it's also a powered up version of GenericArray that might be useful to others, hence the public API.
  • Vector now has Focus and FocusMut APIs for caching index lookups, yielding huge performance gains when performing multiple adjacent index lookups. Vector::iter has been reimplemented using this API, and is now much simpler and about twice as fast as a result, and Vector::iter_mut now runs nearly an order of magnitude faster. Likewise, Vector::sort and Vector::retain are now using FocusMut and run considerably faster as a result.
  • Focus and FocusMut can also be used as stand ins for subslices through the narrow and split_at methods. You can also iterate over foci, making this the most efficient way to iterate over a subset of a Vector.
  • Vector now implements Rayon's parallel iterators behind the rayon feature flag.

Changed

  • As std::ops::RangeBounds is now stabilised in Rust 1.28, the Vector::slice method is now unconditionally available on the stable channel.
  • Union/difference/intersection/is_submap methods on HashMap and OrdMap that take functions now take FnMut instead of Fn. This should not affect any existing code. (#34)
  • Vector::split_off can now take an index equal to the length of the vector, yielding an empty vector as the split result. (#33)
  • Vector::set now returns the replaced value.

Fixed

  • Vector is now represented as a single inline chunk until it grows larger than the chunk size, making it even faster than Vec at small sizes, though clone could now be slower if the clone is expensive (it's still absurdly fast for A: Copy).