im-rc
Immutable collection datatypes (the fast but not thread safe version)
15.1.0
16M downloads/mo
#2424 most downloaded on crates.io
bodil/im-rs
What this package is like to depend on
Last release 4 years ago
no release in 18 months
Ships unpredictably
gaps range from 2 weeks to 2.0 years
Nearly every release is documented
notes for 12 of 13 stable releases
3 versions withdrawn
withdrawn after publishing
8 years old
16 releases · first in 2018
0 releases in the last 12 months
see the full history below
Release timeline
16 releases · Aug 2018 to Apr 2022Releases
latest 16-
15.1.029 Apr 2022Release notes
Open source →Added
-
HashSetnow implementsFrom<Vector<A>>andFrom<&Vector<A>> where A: Clone. -
Fixed
-
Fixed a long standing crash bug in
OrdMap/OrdSet. (#154, #143, #152, #124) -
The
unionmethod on maps/sets will now prefer to mutate the larger set (which leads to less work) rather than the first set. (#163) -
Ensure
TreeFocusonly implementsSend/Syncwhen the underlying type does. (#157, #158) -
There was an issue where nodes in very large
OrdMaps could overflow when removing an element and cause a panic, which has now been fixed. (#141)
Release notes
Open source →Added
HashSetnow implementsFrom<Vector<A>>andFrom<&Vector<A>> where A: Clone.
Fixed
- Fixed a long standing crash bug in
OrdMap/OrdSet. (#154, #143, #152, #124) - The
unionmethod on maps/sets will now prefer to mutate the larger set (which leads to less work) rather than the first set. (#163) - Ensure
TreeFocusonly implementsSend/Syncwhen the underlying type does. (#157, #158) - There was an issue where nodes in very large
OrdMaps could overflow when removing an element and cause a panic, which has now been fixed. (#141) - Assorted doc cleanup. (#150, #173, #186, #194)
-
-
15.0.015 May 2020Release notes
Open source →Changed
- Map iterators now return
(&K, &V)and(&K, &mut V)respectively, to be consistent withstd::collections's API.DiffIterforOrdMaphas also changed in the same manner. (#121)
Removed
- The
poolfeature flag has been removed from theimversion of the crate, asrefpoolno longer supports threadsafe pools. HashSet::iter_mut()has been removed, because if you modify the hashed values in a hash set, you break the hash set.
Added
- The
poolfeature flag was missing from theim-rcversion of the crate, which is the version where it's actually useful. It's been added now. DiffIternow has aDebugimplementation.- There is now a
Vector::is_inline()method to determine whether aVectoris currently inlined. (#129)
Fixed
- A smarter implementation of the sorting algorithm for
Vectorhas improved the performance ofVector::sortby approximately 2x. (#126)
Release notes
Open source →Changed
- Map iterators now return
(&K, &V)and(&K, &mut V)respectively, to be consistent withstd::collections's API.DiffIterforOrdMaphas also changed in the same manner. (#121)
Removed
- The
poolfeature flag has been removed from theimversion of the crate, asrefpoolno longer supports threadsafe pools. HashSet::iter_mut()has been removed, because if you modify the hashed values in a hash set, you break the hash set.
Added
- The
poolfeature flag was missing from theim-rcversion of the crate, which is the version where it's actually useful. It's been added now. DiffIternow has aDebugimplementation.- There is now a
Vector::is_inline()method to determine whether aVectoris currently inlined. (#129)
Fixed
- A smarter implementation of the sorting algorithm for
Vectorhas improved the performance ofVector::sortby approximately 2x. (#126)
- Map iterators now return
-
14.3.003 Mar 2020Release notes
Open source →Changed
propteststrategies have been moved toim::proptest. The previous locations of the strategies (im::vector::proptestetc) are still available, but have been deprecated.
Added
OrdSetandOrdMapnow haveget_prevandget_nextmethods (with equivalentget_prev_mutandget_next_mutmethods forOrdMap) which will return the closest key match to the requested key in the specified direction if the key isn't in the set. (#95)- The
retainmethod, inexplicably missing fromHashMapbut notHashSet, has been added. (#120) - The
get_mutmethod onOrdMapwas, equally inexplicably, private. It has now been made public.
Release notes
Open source →Changed
propteststrategies have been moved toim::proptest. The previous locations of the strategies (im::vector::proptestetc) are still available, but have been deprecated.
Added
OrdSetandOrdMapnow haveget_prevandget_nextmethods (with equivalentget_prev_mutandget_next_mutmethods forOrdMap) which will return the closest key match to the requested key in the specified direction if the key isn't in the set. (#95)- The
retainmethod, inexplicably missing fromHashMapbut notHashSet, has been added. (#120) - The
get_mutmethod onOrdMapwas, equally inexplicably, private. It has now been made public.
-
14.2.017 Jan 2020Release notes
Open source →[14.2.0] - 2020-01-17
Added
- Both map types now have the
get_key_value()method, corresponding to the equivalent additions to the standard library. - The
ptr_eqmethod has been added to all data types, allowing you to test whether two values refer to the same content in memory, by testing for pointer equality. (#117) HashMaphad lost itsArbitraryimplementation for thequickcheckfeature flag. It's now been restored. (#118)- Implementations for
Arbitraryfrom thearbitrarycrate have been added behind thearbitraryfeature flag.
Fixed
- Fixed a bug when reversing a consuming iterator over a
Vectorby replacing the consuming iterator with a much simpler and slightly more efficient version. (#116)
Release notes
Open source →Added
- Both map types now have the
get_key_value()method, corresponding to the equivalent additions to the standard library. - The
ptr_eqmethod has been added to all data types, allowing you to test whether two values refer to the same content in memory, by testing for pointer equality. (#117) HashMaphad lost itsArbitraryimplementation for thequickcheckfeature flag. It's now been restored. (#118)- Implementations for
Arbitraryfrom thearbitrarycrate have been added behind thearbitraryfeature flag.
Fixed
- Fixed a bug when reversing a consuming iterator over a
Vectorby replacing the consuming iterator with a much simpler and slightly more efficient version. (#116)
- Both map types now have the
-
14.1.016 Dec 2019Release notes
Open source →Added
- If you enable the
poolfeature flag, im now supports constructing data types usingrefpoolto speed up chunk allocation. The performance boost will vary between use cases and operating systems, but generally at least a 10% speedup can be expected when constructing a data type from an iterator, and the more complex an operation is, the more likely it is to benefit from being able to quickly reallocate chunks. Note that in order to use this feature, you have to construct your data types using thewith_pool(&pool)constructor, it's not enough just to enable the feature flag.
Release notes
Open source →Added
- If you enable the
poolfeature flag, im now supports constructing data types usingrefpoolto speed up chunk allocation. The performance boost will vary between use cases and operating systems, but generally at least a 10% speedup can be expected when constructing a data type from an iterator, and the more complex an operation is, the more likely it is to benefit from being able to quickly reallocate chunks. Note that in order to use this feature, you have to construct your data types using thewith_pool(&pool)constructor, it's not enough just to enable the feature flag.
- If you enable the
-
14.0.019 Nov 2019Release notes
Open source →Changed
- As
sized-chunksnow requires a slightly more recent version ofrustcto compile, specifically version 1.36.0, so doesim. This is a breaking change, but will of course only affect your code if you're using an olderrustc.
Fixed
Release notes
Open source →Changed
- As
sized-chunksnow requires a slightly more recent version ofrustcto compile, specifically version 1.36.0, so doesim. This is a breaking change, but will of course only affect your code if you're using an olderrustc.
Fixed
- Fixed a quadratic time worst case scenario in the quicksort implementation for
Vector. (#101) - Fixed an edge case bug when splitting and joining large
Vectors. (#105, #107)
- As
-
13.0.018 May 2019Release notes
Open source →The minimum supported Rust version is now 1.34.0.
Changed
im::iter::unfoldnow gives you the owned state value rather than an immutable reference to it, which makes it a little more useful.
Removed
- The deprecated
singletonconstructors have been removed. Please useunitinstead. - The deprecated methods
Vector::chunksandVector::chunks_muthave been removed in favour ofVector::leavesandVector::leaves_mutrespectively. (#50) - The deprecated reference to
sized-chunkshas been removed. If you need it, please use thesized-chunkscrate directly. im::iter::unfold_muthas been removed, as there's no meaningful difference between it and rust-std 1.34.0'sstd::iter::from_fnwith a captured state variable.
Fixed
Vectornow usessized_chunks::InlineArrayinstead of anEmptyenum case to avoid allocation at very small sizes, letting you store a handful of elements on the stack before needing to grow into a full chunk. This has a beneficial effect on performance as well, as there's no pointer into the heap to dereference, making it faster thanstd::vec::Vecin this configuration.- Some complexity timings have been added and corrected. (#87)
OrdSet::is_subset(&self, other)now returns immediately whenselfis larger thanotherand thus could not possibly be a subset of it. (#87)
Release notes
Open source →The minimum supported Rust version is now 1.34.0.
Changed
im::iter::unfoldnow gives you the owned state value rather than an immutable reference to it, which makes it a little more useful.
Removed
- The deprecated
singletonconstructors have been removed. Please useunitinstead. - The deprecated methods
Vector::chunksandVector::chunks_muthave been removed in favour ofVector::leavesandVector::leaves_mutrespectively. (#50) - The deprecated reference to
sized-chunkshas been removed. If you need it, please use thesized-chunkscrate directly. im::iter::unfold_muthas been removed, as there's no meaningful difference between it and rust-std 1.34.0'sstd::iter::from_fnwith a captured state variable.
Fixed
Vectornow usessized_chunks::InlineArrayinstead of anEmptyenum case to avoid allocation at very small sizes, letting you store a handful of elements on the stack before needing to grow into a full chunk. This has a beneficial effect on performance as well, as there's no pointer into the heap to dereference, making it faster thanstd::vec::Vecin this configuration.- Some complexity timings have been added and corrected. (#87)
OrdSet::is_subset(&self, other)now returns immediately whenselfis larger thanotherand thus could not possibly be a subset of it. (#87)
-
12.3.408 Apr 2019Release notes
Open source →Changed
Cloneconstraints have been further relaxed on maps and sets, so that you can now lookup and iterate over them without requiring aCloneconstraint (though you do still needCloneto actually insert data into them to lookup or iterate over). (#81)
Fixed
Release notes
Open source →Changed
Cloneconstraints have been further relaxed on maps and sets, so that you can now lookup and iterate over them without requiring aCloneconstraint (though you do still needCloneto actually insert data into them to lookup or iterate over). (#81)
Fixed
- Enforces the latest bugfix release of sized-chunks. (#78)
- Another edge case bugfix to
Vector's size table handling. (#79)
-
12.3.311 Mar 2019Release notes
Open source →Fixed
- A number of issues were fixed where
Vector's size table would get out of sync with the node structure if exercised too much and cause erroneous behaviour. (#72, #74) - Comprehensive generative tests were added to test all data structures through more unexpected code paths.
- A number of issues were fixed where
-
12.3.205 Mar 2019Release notes
Open source →Changed
Cloneconstraints on all data structures, as well as relevant constraints on maps and sets, have been relaxed where possible, so that you can now construct empty instances and call most query methods without requiring values implementCloneetc. (#63)
Fixed
Release notes
Open source →Changed
Cloneconstraints on all data structures, as well as relevant constraints on maps and sets, have been relaxed where possible, so that you can now construct empty instances and call most query methods without requiring values implementCloneetc. (#63)
Fixed
- Constructing an empty
Vectorwill not allocate any heap memory, instead deferring allocation until you perform an operation that would increase its length. (#65) - Some bugs arising when using
Vector::appendrepeatedly were fixed. (#67, #70)
-
12.3.119 Feb 2019Release notes
Open source →Changed
- Unsafe chunks have been separated out into the
sized-chunkscrate, which is now a dependency ofim.
- Unsafe chunks have been separated out into the
-
12.3.015 Jan 2019Release notes
Open source →Added
singletonmethods have been deprecated and renamed tounit.Vector::chunksandVector::chunks_muthave been deprecated and renamed toleavesandleaves_mutto avoid confusion withVec::chunks. (#50)
Fixed
- Fixed an issue where the
HashMapdraining iterator might access uninitialised memory leading to undefined behaviour. (#60) - Fixed multiple issues in
Vector::split_offandVector::appendthat would cause lookup errors and unexpectedly unbalanced trees. (#55).
-
12.2.012 Oct 2018 withdrawnRelease notes
Open source →Added
OrdMapandOrdSetnow have arange()method which makes an iterator over a bounded subset of the values. The improved iterator implementation is also considerably more efficient than the previous (about an order of magnitude faster for nontrivial data sets).iter()has been updated to take advantage of this, and is now just an alias forrange(..). (#27)FocusMutnow has anunmutmethod to turn it into an immutableFocus, releasing its exclusive hold on the underlyingVector.Focusnow implementsClone.
-
12.1.025 Sep 2018 withdrawnRelease notes
Open source →Added
- Maps and sets now have the
clearmethod just likeVector. (#46)
Changed
- Single chunk
Vectors are no longer allocated directly on the stack, meaning that they're now comparable in performance tostd::vec::Vecrather than slightly faster, but they also won't eat up your stack space quite as quickly, and they'll clone without copying and share structure with clones as you'd expect.
- Maps and sets now have the
-
12.0.030 Aug 2018 withdrawnRelease notes
Open source →Starting with this release, the
arcflag is gone, in favour of publishingimas two separate crates:im(usingArc) andim-rc(usingRc). They're identical (and built from the same code), except thatimis thread safe andim-rcis 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
Chunkdatatype that's used to buildVectorandOrdMaphas been exposed and made generally usable. It's somewhere between aGenericArrayand 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 ofGenericArraythat might be useful to others, hence the public API. Vectornow hasFocusandFocusMutAPIs for caching index lookups, yielding huge performance gains when performing multiple adjacent index lookups.Vector::iterhas been reimplemented using this API, and is now much simpler and about twice as fast as a result, andVector::iter_mutnow runs nearly an order of magnitude faster. Likewise,Vector::sortandVector::retainare now usingFocusMutand run considerably faster as a result.FocusandFocusMutcan also be used as stand ins for subslices through thenarrowandsplit_atmethods. You can also iterate over foci, making this the most efficient way to iterate over a subset of aVector.Vectornow implements Rayon's parallel iterators behind therayonfeature flag.
Changed
- As
std::ops::RangeBoundsis now stabilised in Rust 1.28, theVector::slicemethod is now unconditionally available on the stable channel. - Union/difference/intersection/is_submap methods on
HashMapandOrdMapthat take functions now takeFnMutinstead ofFn. This should not affect any existing code. (#34) Vector::split_offcan now take an index equal to the length of the vector, yielding an empty vector as the split result. (#33)Vector::setnow returns the replaced value.
Fixed
Vectoris now represented as a single inline chunk until it grows larger than the chunk size, making it even faster thanVecat small sizes, thoughclonecould now be slower if the clone is expensive (it's still absurdly fast forA: Copy).
- The
-
11.0.230 Aug 2018Nothing published for this version