In large graphs we're wasting ~8% of the heap for duplicate arrays in AdjacentNodes.offsets.
That array is only ever mutated in AdjacentNodes.setOffset in a very constraint and straighforward way, so we could easily optimise it.
E.g. we could have a global TIntObjectMap as a cache that maps from the checksum of a given offset array to the array.
In large graphs we're wasting ~8% of the heap for duplicate arrays in
AdjacentNodes.offsets
. That array is only ever mutated inAdjacentNodes.setOffset
in a very constraint and straighforward way, so we could easily optimise it.E.g. we could have a global
TIntObjectMap
as a cache that maps from the checksum of a given offset array to the array.