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 buildVector
andOrdMap
has been exposed and made generally usable. It's somewhere between aGenericArray
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 ofGenericArray
that might be useful to others, hence the public API. Vector
now hasFocus
andFocusMut
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, andVector::iter_mut
now runs nearly an order of magnitude faster. Likewise,Vector::sort
andVector::retain
are now usingFocusMut
and run considerably faster as a result.Focus
andFocusMut
can also be used as stand ins for subslices through thenarrow
andsplit_at
methods. You can also iterate over foci, making this the most efficient way to iterate over a subset of aVector
.Vector
now implements Rayon's parallel iterators behind therayon
feature flag.
Changed
- As
std::ops::RangeBounds
is now stabilised in Rust 1.28, theVector::slice
method is now unconditionally available on the stable channel. - Union/difference/intersection/is_submap methods on
HashMap
andOrdMap
that take functions now takeFnMut
instead ofFn
. 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 thanVec
at small sizes, thoughclone
could now be slower if the clone is expensive (it's still absurdly fast forA: Copy
).