3 ms·
Interestingly, I was just reading the book "Java Concurrency in Practice" where the author measures the performance of an array-based hash table like the one de
by commandlinefan 2y ago
Interestingly, I was just reading the book "Java Concurrency in Practice" where the author measures the performance of an array-based hash table like the one described here with a linked-list based hash table and finds that the linked list comes out ahead performance-wise.
- kevincox 2y agoA JVM with a moving GC can have wildly difference performance characteristics than C. A moving collector can use a bump allocator which can result in these independently allocated chain nodes ending up adjacent in memory which will mitigate lots of the cache miss costs of linked hash tables. Especially in microbenchmarks where basically all allocations come from the hash table under measurement. In C it is much more likely that these allocations are spread around memory and in different cache lines.
- NoahKAndrews 2y agoThat's a fantastic book. I hope it gets a new edition at some point.
- commandlinefan 2y agoI'd love to read it if it did, but honestly I wonder if enough's changed to warrant a new edition. Everything I'm reading now is still relevant.
- NoahKAndrews 2y agoVirtual threads seem like a change worth covering, but yes, it's hardly obsolete.