From: dblock Date: 2011-01-20T10:55:31+09:00 Subject: Re: Improving performance of hash math In case someone reads this for the purpose of the algorithms, and not that it influences benchmarks, but the last two have bugs: the second sum needs to do ! lhs.has_key? k. You want to do (right[i] - left[i]) ** 2 for the left hash (items in the left hash only and in both the left and the right hash), then add right[i] for all items that are in the right hash only. Back to the original question: anyone thinks we can do this for millions of items?