Archive for February, 2015

Java TreeSet copying

There are (at least) three ways to shallow copy a TreeSet in Java: the copy constructor, addAll(), and clone(). A piece of code I’m running needs to copy a few fairly big TreeSets, so I was interested to see if there were any performance differences. It turns out that there are. So, we’re generating 5 […]

Read More…