Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Use Fastutil Collections in Performance Critical Areas #4
Fastutil collections (http://fastutil.dsi.unimi.it/) are more efficient versions of java/scala collection classes. See the website for more details.
For this patch, I've replaced the data structures in the code paths relevant to walks and traversals with fastutil data structures.
I'm about to test this one in our internal service. I expect a large improvement in our young gen pause time. Currently, scala lists keep 2 objects for every primitive element - one "::" object and another to box the element. In our random walk logic, we keep track of all List[Int] paths leading to every traversed node during the walk, which results in a very large # of objects.
I can say that it lowered the avg response latency from 50ms to 1ms for another code path in our service, which was using a mutable.Hash[Int, Int] instead of fastutil's Int2IntOpenHashMap. This change also increased the throughput (with respect to garbage collection) from 90% to 96%, and reduced young gc latency by 40%.