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

[jruby] a couple refactorings - avoid copy-ing bytes #2730

merged 5 commits into from Nov 1, 2021


Copy link

@kares kares commented Oct 27, 2021


Was reviewing the JRuby native bits and noticed a few low hanging fruits around unnecessary byte[] copying.
The String instances retrieved from read / extract will now be ASCII-8BIT just like the C bits (w rb_str_new).

Also, the exception handling seems to be incomplete thus it would be better to allow to raise the original exception instead of dummy wrapping into a Java RuntimeException, and where wrapping is present let's have the original Java cause around.

Your checklist for this pull request

  • I have reviewed the guidelines for contributing to this repository.
  • I have added (or updated) appropriate tests if this PR fixes a bug or adds a feature.
  • My pull request is 100 lines added/removed or less so that it can be easily reviewed.
  • If this PR doesn't need tests (docs change), I added [ci skip] to the title of the PR.
  • If this closes any issues, I have added "Closes #issue" to the PR description or my commit messages.
  • I have updated the documentation accordingly.
  • All new and existing tests passed, including Rubocop.

@dentarg dentarg added the waiting-for-review Waiting on review from anyone label Oct 31, 2021
Copy link


@nateberkopec nateberkopec merged commit 66962e4 into puma:master Nov 1, 2021
JuanitoFatas pushed a commit to JuanitoFatas/puma that referenced this pull request Sep 9, 2022
* [jruby][refactor] avoid byte[] copy-ing

* [jruby][refactor] proper ASCII string creation

* [jruby][refactor] drop unused KeyStore instances

* [jruby][refactor] review exception handling (catch less)

* [jruby][refactor] no need to copy local byte[] array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
jruby refactor waiting-for-review Waiting on review from anyone
None yet

Successfully merging this pull request may close these issues.

None yet

4 participants