3 ms·
Show HN: OpenHFT Collections – the fastest Java hash sets and maps ever
- justinsb 12y agoLooks interesting, but it's difficult to understand why it is faster (i.e. the design decisions you made). From poking around, I can see that you have specialized each collection for the primitive types, to avoid boxing/unboxing. I'm not sure if there's more to it than this though! I wasn't able to quickly locate the actual storage code though - do you store values as a primitive array or do you use a ByteBuffer? It would also be useful to understand how this compares to e.g. Trove. Just some friendly feedback - project looks awesome; thanks for open-sourcing it.
- leventov 12y agoComarison with Trove and other primitive collections libs: http://java.dzone.com/articles/time-memory-tradeoff-example http://java.dzone.com/articles/time-memory-tradeoff-example Why faster: - no supplemental "states" array in open adressing implementation - keys and values are stored "in parallel" in the single array, whenever possible: https://github.com/OpenHFT/hftc/issues/23 https://github.com/OpenHFT/hftc/issues/23 - generally, attention to the finest detail in implementation There is no "actual storage code" - it is 95% generated. Thank you.