Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement open addressing algorithm for RubyHash
to improve the performance by leverage better cache locality. Switching from closed addressing hash algorithm (linked list) to open addressing hashing because of a better cache locality on modern CPU architectures. Furthermore we removed almost all RubyHashEntry objects for smaller memory allocation. This is already implemented in MRI since 2.4, see https://bugs.ruby-lang.org/issues/12142 Small hashes (less than 8 entries) are now implemented via a linear search which reduces memory allocation in this case and has almost no performance implication. For a fast bucket skip we maintain in this case a hashes array to cache the hash values. Implements jruby#4708 & jruby#2989
- Loading branch information