vʌvr (formerly called Javaslang) is a non-commercial, non-profit object-functional library that runs with Java 8+. It aims to reduce the lines of code and increase code quality.
This merge requests explores how a migration of the HAMT trie to a CHAMP trie could look like:
HashSet, HashMap: Replaces the internal HAMT data structure by a CHAMP data structure.
LinkedHashSet, LinkedHashMap: Replaces the internal HAMT+Seq data strucures by CHAMP+Vector data structures.
The changes are intended to affect the performance of vavr, but are not supposed to change any API.
The changes are somewhat sub-optimal and somewhat over-complicated, because I strived to not break any of the unit tests. (I believe that I should change a number of unit tests, because some rely on the iteration sequence of the HAMT implementation. However, the vavr API specifies that the iteration sequence is unspecified.)
I do not expect that this draft can be merged in the current form. In JHotDraw 8 we have a mutable 'partner' collection for every immutable collection. This allows to test all immutable collections with the 'guava-testlib' library. Which provides very through tests. I did not want to change the API of vavr - so I have downgraded the mutable collections to transient collections. But I have not written new tests yet. So code coverage by unit tests is currently lower than I want it to be.
This is a draft intended for discussion.
This merge requests explores how a migration of the HAMT trie to a CHAMP trie could look like:
The changes are somewhat sub-optimal and somewhat over-complicated, because I strived to not break any of the unit tests. (I believe that I should change a number of unit tests, because some rely on the iteration sequence of the HAMT implementation. However, the vavr API specifies that the iteration sequence is unspecified.)
The code is a port from the JHotDraw 8 collections module. https://github.com/wrandelshofer/jhotdraw8/tree/main/org.jhotdraw8.collection The JHotDraw 8 collections are in turn a port of the 'capsule' collection library https://github.com/usethesource/capsule, and of vavr.
I do not expect that this draft can be merged in the current form. In JHotDraw 8 we have a mutable 'partner' collection for every immutable collection. This allows to test all immutable collections with the 'guava-testlib' library. Which provides very through tests. I did not want to change the API of vavr - so I have downgraded the mutable collections to transient collections. But I have not written new tests yet. So code coverage by unit tests is currently lower than I want it to be.