3 ms·
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 inde
by kevincox 2y ago
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.