Donald Raab
Oct 3, 2023

--

If you read the blog you will see I introduce the concept of a Pool. The UnifiedSet class in Eclipse Collections implements both Set and Pool. The primary difference between Set and Pool is that a Pool has get and put methods, where a Set does not. The primary difference between a Pool and a Map is that a Pool does not have keys and values, just keys. If a Set had a get method, it would essentially be a Pool. In a large cache space where millions of objects are cached and long lived and have references to immutable objects like String and LocalDate, pooling data to save memory becomes extremely useful. A Set/Pool (which is not backed by a Map) is a more memory efficient way of pooling immutable data.

--

--

Donald Raab
Donald Raab

Written by Donald Raab

Java Champion. Creator of the Eclipse Collections OSS Java library (https://github.com/eclipse/eclipse-collections). Inspired by Smalltalk. Opinions are my own.

No responses yet