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

Additional pack/unpack optimizations #5651

Merged
merged 3 commits into from Mar 13, 2019

Conversation

Projects
None yet
1 participant
@headius
Copy link
Member

headius commented Mar 13, 2019

A couple more items for pack/unpack:

  • Outline cases in pack logic to aid JVM JITs that have trouble with large switches or large methods.
  • Reduce complexity of String#unpack1 to a single block, rather than using catch/throw.

This may produce a small improvement in pack performance, but mostly it's to preemptively deal with JVMs that have trouble with large switches or methods, and also to make the code a bit easier to read.

headius added some commits Mar 13, 2019

Outline pack switch cases to assist JVM JIT optimization.
This is similar in nature to the changes in #5647 but there's no
specific performance regression I'm fixing here. We have seen
issues with switch optimization across numerous JVM versions, so
this seems like a good idea. It also makes the code easier to
follow.
catch/throw is unnecessary to do a non-local return.
Reduces overhead of unpack1 from two blocks to one.

@headius headius added this to the JRuby 9.2.7.0 milestone Mar 13, 2019

@headius

This comment has been minimized.

Copy link
Member Author

headius commented Mar 13, 2019

See #5647

@headius headius merged commit a0675a5 into jruby:master Mar 13, 2019

1 check failed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details

@headius headius deleted the headius:outline_pack branch Mar 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.