4 ms·
This is very true and the suck of Java today, but fyi you can improve this exact scenario by using a special IntMap etc, which there are many libraries for (Lib
by winrid 4y ago
This is very true and the suck of Java today, but fyi you can improve this exact scenario by using a special IntMap etc, which there are many libraries for (LibGDX has some, and Caffeine has off-heap maps).
- JanecekPetr 4y agoNot Caffeine, that's the caching library. You probably meant one of FastUtil, Eclipse Collections, Koloboke, HPPC(-RT), they all provide primitive specializations of Maps and Collections. For off-heap maps, now that's more interesting! I know about Chronicle Map, MapDB, https://github.com/snazy/ohc https://github.com/snazy/ohc and https://github.com/RuedigerMoeller/fast-serialization/wiki/Off-Heap-Maps,-Persistent-Maps https://github.com/RuedigerMoeller/fast-serialization/wiki/O....
- NovaX 4y agoAnother to add to your collection, https://github.com/yahoo/Oak https://github.com/yahoo/Oak
- deleted 4y ago[deleted]
- NovaX 4y agoCaffeine doesn't offer off-heap maps or primitive collections (many other great libraries do). It does use a data sketch for compact frequency storage and optimizes against the cpu cache line to avoid unnecessary memory accesses. There are many dimensions to being hardware efficient.
- winrid 4y agooh, you're right. Weird, wonder why I thought it was off heap. No wonder that service has higher memory usage than I was expecting. LOL
- winrid 4y agocoming back to this - amazing what you can accomplish with String.intern() and switching to Shenandoah GC. Memory usage is about 2.2gb now for 800mb of cache entries: http://media-server.fastcomments.com:8881/stats http://media-server.fastcomments.com:8881/stats About 500mb of that is netty SSL session cache...