Menu

Immutable Collections for Java / Blog: Recent posts

1.8 release

I have just released version 1.8 of the Javimmutable-Collections library. The primary improvement in 1.8 is a replacement of the old sparse array based JImmutableList with a new one built on 32-way trees. This new implementation uses less memory and offers 30% better performance. There are a few other minor improvements such as fixing IteratorAdaptor's requirement that you call hasNext() before calling next() and adding equals() and hashCode() implementations for JImmutableListMaps.... read more

Posted by Brian Burton 2014-08-30

Faster Lists

I have posted a 1.8-SNAPSHOT release to maven central containing a brand new JImmutableList implementation based on 32-way trees optimized for fast lookup at any index and allowing insertion and deletion only at the head/tail of the list. Starting with 1.8 this implementation will replace the JImmutableArray based JImmutableLists of previous releases.

The new trees are simpler and consume less memory than the old sparse array based list. The old implementation had the advantage of reusing the sparse array classes already present in the library. Unfortunately they also had the potential limitation that if you performed more than 2.4ish billion inserts and deletes on a single list it could exhaust the range of possible indexes for the underlying array. I warned about that in the comments and it was extremely unlikely to happen in real programs (who does 2.4 billion updates to an immutable list???) but it still bugged me to have that sort of limitation built in.... read more

Posted by Brian Burton 2014-08-27

1.7 release

I have just released version 1.7 of the javimmutable-collections library. The new artifacts have been published to maven central and a new zip file has been uploaded to Sourceforge. This release focuses on useability improvements.

  • adds JSR-305 annotations @Immutable, @Nonnull, and @Nullable where appropriate
  • improves generic parameters on a number of methods to make them more widely useable
  • adds new methods and overloads to JImmutableSet to improve interoperability with java.util.Set
  • adds MutableBuilder interface for efficiently building large JImmutableLists... read more
Posted by Brian Burton 2014-07-08

1.6 release

I have just released version 1.6 of the javimmutable-collections library. The new artifacts have been published to maven central and a new zip file has been uploaded to Sourceforge. This release focuses on performance and memory consumption as well as a number of useability improvements.

  • Improves performance and reduces memory consumption of array lists, sparse arrays and hash maps by reducing the average trie depth.
  • Improves performance in the presence of frequent hash code collisions by using 2-3 trees to resolve hash collisions when possible.
  • Improves useability by adding wildcards to the type declarations in the Functions and JImmutables static methods.
  • Allows use of foreach loop for iteration over Cursors by making every Cursor implement Iterable.... read more
Posted by Brian Burton 2014-04-12

1.5 release

I have just released version 1.5 of the javimmutable-collections library. This version contains a major overhaul of the array list and hash map implementations. The primary goal of this release was to improve performance. With that in mind the old trie implementations were replaced with newer, simpler ones that offloaded most of the work onto the Bit32Array classes. Coupled with various optimizations in those classes this release has doubled the performance of the JImmutableHashMap class.... read more

Posted by Brian Burton 2014-03-02

1.4 release

Javimmutable-collections 1.4 has been released! The new artifacts have been deployed to maven central and a new zip file has been updated to sourceforge. This release includes:

  • JImmutables.insertOrderMap() creates a JImmutableMap whose Cursor iterates over elements in the order that they were originally inserted into the map. This is similar to Java's LinkedHashMap. Assign and delete are slower on these maps but iteration is similar to a sorted map.... read more
Posted by Brian Burton 2014-02-15

1.2 Release

I have released version 1.2 with some unit test improvements, new Tuple and Func interfaces, and a minor performance tweaks. The project web site has been updated with the latest javadoc and the files section on sourceforge contains the newest zip file. Maven Central should have the new artifact soon.

Posted by Brian Burton 2013-11-28

1.1 Release

Version 1.1 is now available on sourceforge and has been submitted to maven central.

This version adds:
* improved JImmutables constructor methods that reuse collections when possible and optimize the creation of new JImmutableLists from arrays and java.util.Lists.
* new Cursor implementations useful for writing parsers with Cursors backed by java.io.Readers.
* some API improvements to enhance useability
* more unit tests... read more

Posted by Brian Burton 2013-11-16

1.0.0 on mavencentral

The 1.0.0 release is available in the files section on SourceForge and is also available via maven in maven central. You can add Javimmutable Collections to your maven project by adding this dependency to your pom.xml

<dependency>
  <groupId>org.javimmutable</groupId>
  <artifactId>javimmutable-collections</artifactId>
  <version>1.0.0</version>
</dependency>

I have also started submitting 1.0.1-SNAPSHOT releases to the snapshots repository in maven central if you want the bleeding edge.... read more

Posted by Brian Burton 2013-10-24

1.0.0 Released

Javimmutable Collections version 1.0.0 has been released! This version includes JImmutableMap, JImmutableSet, and JImmutableList collections. The sets and maps are available in hash trie and tree (sorted) versions and the lists are available in trie and tree (random access) versions. They all provide adapters for backward compatibility with code that expects unmodifiable java.util collections.

All of the collections are fully immutable so they can be shared without synchronization but also have insert and delete methods that efficiently create modified versions of themselves. When adding or deleting values the collections return new versions of themselves that share as much as possible of the original collection's internal structure. The aggressive structure sharing minimizes memory consumption and allows the collections to have performance similar to the java.util collections. ... read more

Posted by Brian Burton 2013-10-14
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.