[erlang-questions] Faster ets:lookups
Jesper Louis Andersen
Sat Aug 14 22:33:25 CEST 2010
On Sat, Aug 14, 2010 at 8:46 PM, tom kelly <> wrote:
> Before I measured it I would have bet my house on the adler calculation
> taking most of the execution time, but it seems that the ets lookup takes
> just under three times as much! 4.5 seconds for the adler calculation, 12
> seconds for the ets lookup.
In modern architectures, what you pay for tend to be not clock cycles
but memory locality and bandwidth abuse. Clearly accessing a fairly
big ETS table might incur cache misses. Perhaps even more than
calculating the adler checksum, which can be prefetched into memory.
More information about the erlang-questions