C
Chris Uppal
Mark said:Newly allocated objects are usually adjacent in memory regardless of
their type. Depending on the garbage collector, objects with links to
each other may well be copied to nearby locations in the main heap.
[I'm mostly repeating myself, but just to bring some closure to this]
Sure, but hash-tables don't tend to place sequentially-allocated objects in
sequential slots. The GC will probably group the chain-links together, but
probably not the objects refered to by the links. In the end open chaining adds
another layer of indirection, double-hashing adds an extra "bounce" to the
memory access patterns. It's up to the developer to choose (with or without
measurement) a design which appeals; my point is only that considerations of
the /number/ of probes doesn't exhaust the influences on performance.
-- chris