From #103 (comment)
I wonder if it would improve performance to pool these using something like IonJava's RecyclingStack. We could get away with having one per depth level right?
I'm intentionally not using a recycling stack because on L154, we wrap it in an immutable list, and then forget about the underlying mutable reference.
However, it would be worth investigating whether there is a performance benefit to having a pool of ArrayLists that have a relatively larger capacity, and then copying to an exact-sized immutable list.
From #103 (comment)