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

Reduced the number of String allocations for the NONE parameterList case. #1399

merged 1 commit into from Jan 13, 2014


None yet
3 participants
Copy link

nirvdrum commented Jan 13, 2014

Please double-check me on this, but I think previously "NONE" would only be appended if the builder was empty. Rather than append to the builder and convert to a String, which will allocate a new copy of the String, I just return the String literal directly. In a sample of a production app that was up for < 15 min., I had 6,346 copies of this String.


This comment has been minimized.

Copy link

headius commented Jan 13, 2014

The patch is good. I'm not sure 6k strings is going to be a substantial hit, but we might as well not be wasteful. Does this number continue to go up after JIT settles down?

headius added a commit that referenced this pull request Jan 13, 2014

Merge pull request #1399 from nirvdrum/reduce_string_duplication
Reduced the number of String allocations for the NONE parameterList case.

@headius headius merged commit 8b7a6f9 into jruby:jruby-1_7 Jan 13, 2014

1 check failed

default The Travis CI build failed

This comment has been minimized.

Copy link
Contributor Author

nirvdrum commented Jan 13, 2014

TorqueBox slows to a crawl when I enable the YourKit agent so I couldn't leave this running in production for much longer. It probably wasn't super significant, but as you hinted, I also had no idea if it ever caps off. I took it to mean there was extra allocations on all non-JITted calls with empty params.

@enebo enebo added this to the JRuby 1.7.11 milestone Feb 21, 2014

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.