Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new ConcurrentMap backend for TruffleRuby #907

Merged

Conversation

wildmaples
Copy link
Contributor

We've created a new backend for more efficient mapping on TruffleRuby using Java's ConcurrentHashMap library - oracle/truffleruby#2339

The new backend is faster than the previous implementation for TruffleRuby, AtomicReferenceMapBackend. And also faster than MRI and JRuby:

675% relative to MRI and 539% relative to JRuby.

Changes

  • Add a TruffleRubyMapBackend that inherits from the new TruffleRuby::ConcurrentMap
  • Use the TruffleRubyMapBackend backend for Concurrent::Map on TruffleRuby if available

Testing

The new backend has been tested locally and passes the map_spec on this gem

else
require 'concurrent/collection/map/atomic_reference_map_backend'
AtomicReferenceMapBackend
end else
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is borked a bit.

@chrisseaton
Copy link
Member

Sorry didn't realise I left my only comment as 'pending'!

Copy link
Member

@chrisseaton chrisseaton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@chrisseaton
Copy link
Member

I need to do a bit of exploring to remind myself how to do a release, but I'll get onto that.

@chrisseaton chrisseaton merged commit aa83e25 into ruby-concurrency:master May 7, 2021
@chrisseaton chrisseaton deleted the truffleruby-map-backend branch May 7, 2021 23:41
@wildmaples wildmaples restored the truffleruby-map-backend branch May 10, 2021 20:40
@pitr-ch
Copy link
Member

pitr-ch commented May 24, 2021

@chrisseaton do you need a new release? I'll have time next week.

@chrisseaton
Copy link
Member

Yes please! I was going to reach out at some point. I was looking at trying myself but it looks fairly complicated to release. Can you please document how you do it as you go through the steps? Thanks very much.

@chrisseaton chrisseaton deleted the truffleruby-map-backend branch May 24, 2021 18:10
@pitr-ch
Copy link
Member

pitr-ch commented May 26, 2021

Ok, I'll see what I can do about improving the release doc.

@pitr-ch
Copy link
Member

pitr-ch commented Jun 3, 2021

I've flatten the condition 382550c
Release will land soon.

@pitr-ch
Copy link
Member

pitr-ch commented Jun 5, 2021

The build doc was updated in 5f06b9b

@pitr-ch
Copy link
Member

pitr-ch commented Jun 5, 2021

released.

@eregon
Copy link
Collaborator

eregon commented Jul 16, 2021

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants