Reduced the number of String allocations for the NONE parameterList case.#1399
Merged
headius merged 1 commit intojruby:jruby-1_7from Jan 13, 2014
nirvdrum:reduce_string_duplication
Merged
Reduced the number of String allocations for the NONE parameterList case.#1399headius merged 1 commit intojruby:jruby-1_7from nirvdrum:reduce_string_duplication
headius merged 1 commit intojruby:jruby-1_7from
nirvdrum:reduce_string_duplication
Conversation
Member
|
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
Reduced the number of String allocations for the NONE parameterList case.
Contributor
Author
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.