We spend a reasonable amount of time computing and recomputing the hash value of TupleStructs. At the expense of some memory (~4 bytes per tuple), we could memoize and cache the result of TupleStruct#hash. On a quick join benchmark (test/perf/join_bench.rb), this improves performance by about 10%.
It only works when tuples are immutable, but they probably should be anyway.
We spend a reasonable amount of time computing and recomputing the hash value of TupleStructs. At the expense of some memory (~4 bytes per tuple), we could memoize and cache the result of
TupleStruct#hash
. On a quick join benchmark (test/perf/join_bench.rb
), this improves performance by about 10%.It only works when tuples are immutable, but they probably should be anyway.