News for hackers. Stuff that matters.
Re:A hash table by any other name by commandlinefan on Friday July 26, 2024 @06:00PM (#41082692)
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.
Re:A hash table by any other name by kevincox on Saturday July 27, 2024 @06:50AM (#41085694)
A 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.

Re:A hash table by any other name by NoahKAndrews on Sunday July 28, 2024 @01:47AM (#41091448)
That's a fantastic book. I hope it gets a new edition at some point.
Re:A hash table by any other name by commandlinefan on Monday July 29, 2024 @09:10AM (#41100184)
I'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.
Re:A hash table by any other name by NoahKAndrews on Friday August 09, 2024 @02:20AM (#41199231)
Virtual threads seem like a change worth covering, but yes, it's hardly obsolete.