|
|
|
|
|
by martincmartin
3359 days ago
|
|
The x-axis is the number of iterations, i.e. the number of lookups. The collection is always size 1,000,000. Also, each of those lookups is for the exact same entry, so after the first time, it'll be all cache hits. Well, except for the std::vector, which is what you're talking about... :) |
|
Furthermore adjacent strings are likely to be adjacent in memory, from which I would naively expect cache prefetching to succeed.
Additionally, the curve is quadratic (if at all), not linear. I bet the author looked up all n strings from the vector of n strings.