Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5aa064b4ae68
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e483fb225184
Choose a head ref

Commits on Aug 4, 2018

  1. 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 #4708 & #2989
    ChrisBr committed Aug 4, 2018
    Copy the full SHA
    69d19c4 View commit details
  2. Fix small hash allocation

    ChrisBr committed Aug 4, 2018
    Copy the full SHA
    7ec8091 View commit details
  3. Fix -Ptest test suite

    ChrisBr committed Aug 4, 2018
    Copy the full SHA
    70dac53 View commit details
  4. Fix compilation errors

    ChrisBr committed Aug 4, 2018
    Copy the full SHA
    dc11e38 View commit details
  5. Fix StringOnlyRubyHash

    ChrisBr committed Aug 4, 2018
    Copy the full SHA
    a1ed645 View commit details
  6. Implement allSymbols

    ChrisBr committed Aug 4, 2018
    Copy the full SHA
    db6d81a View commit details
  7. Fix gemspec error

    ChrisBr committed Aug 4, 2018
    Copy the full SHA
    ac56023 View commit details
  8. Copy the full SHA
    a979c45 View commit details
  9. Copy the full SHA
    93d034b View commit details
  10. Fix deleting first element

    ChrisBr committed Aug 4, 2018
    Copy the full SHA
    0a851a1 View commit details
  11. Copy the full SHA
    31f94de View commit details
  12. Copy the full SHA
    e05189a View commit details
  13. Fix any

    ChrisBr committed Aug 4, 2018
    Copy the full SHA
    4cc1196 View commit details
  14. Check resize for small hash

    ChrisBr committed Aug 4, 2018
    Copy the full SHA
    4f04047 View commit details
  15. Fix json parser test

    ChrisBr committed Aug 4, 2018
    Copy the full SHA
    108ddb2 View commit details
  16. Fix ENV when key got deleted

    ChrisBr committed Aug 4, 2018
    Copy the full SHA
    d158c06 View commit details
  17. More fixes for ENV

    ChrisBr committed Aug 4, 2018
    Copy the full SHA
    1344ba0 View commit details
  18. Refactor set value

    ChrisBr committed Aug 4, 2018
    Copy the full SHA
    3d44b3a View commit details
  19. Fix BaseIterator remove

    ChrisBr committed Aug 4, 2018
    Copy the full SHA
    de95d26 View commit details
  20. Return correct value

    ChrisBr committed Aug 4, 2018
    Copy the full SHA
    468b346 View commit details
  21. Fix start and end pointers

    ChrisBr committed Aug 4, 2018
    Copy the full SHA
    ab40019 View commit details
  22. Copy the full SHA
    fc561b1 View commit details
  23. Fix rehashing

    ChrisBr committed Aug 4, 2018
    Copy the full SHA
    65297b9 View commit details
  24. Fix base iterator delete

    ChrisBr committed Aug 4, 2018
    Copy the full SHA
    57972fb View commit details

Commits on Aug 5, 2018

  1. Remove small hash

    which basically just created a linked list.
    This approach is not possible anymore with open addressing.
    As open addressing hashes are anyway compacter, we don't need it anymore.
    ChrisBr committed Aug 5, 2018
    Copy the full SHA
    6ac904d View commit details

Commits on Aug 6, 2018

  1. Merge pull request #5215 from ChrisBr/performance/hash

    Open addressing algorithm for RubyHash
    headius authored Aug 6, 2018
    Copy the full SHA
    e483fb2 View commit details
6 changes: 3 additions & 3 deletions core/src/main/java/org/jruby/RubyGlobal.java
Original file line number Diff line number Diff line change
@@ -472,14 +472,14 @@ public RubyHash to_hash() {
}

@Override
protected RubyHashEntry internalGetEntry(IRubyObject key) {
if (size == 0) return NO_ENTRY;
protected IRubyObject internalGet(IRubyObject key) {
if (size == 0) return null;

if (!isCaseSensitive()) {
key = getCorrectKey(key.convertToString());
}

return super.internalGetEntry(key);
return super.internalGet(key);
}

@Override
Loading