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

More string interpolation optimizations #8236

Merged
merged 1 commit into from
May 14, 2024

Conversation

headius
Copy link
Member

@headius headius commented May 14, 2024

The string interpolation optimizations in #8180 left some improvements on the table. This PR implements those missing bits.

  • The buffer created for the initial string when starting from a static segment was re-copying the buffer twice.
  • Encoding was being re-set multiple times for no reason.

I also added more logging of dstring forms in the indy site and some additional cases in the benchmark. It's now consistently much faster than the old logic.

@headius headius added this to the JRuby 10.0.0.0 milestone May 14, 2024
* Don't re-copy the buffer when creating initial buffer from first
  static string.
* Log how the dstring has been bound by indy
* Additional cases in benchmark
* Benchmark reuses proc to omit block creation overhead.
* Stringable returns same frozen string to avoid new string cost.
@headius headius force-pushed the more_string_interpolation_optz branch from 9fa971b to b4ec0e9 Compare May 14, 2024 07:44
@headius headius merged commit 969a774 into jruby:9.5-dev May 14, 2024
36 of 59 checks passed
@headius headius deleted the more_string_interpolation_optz branch May 14, 2024 07:51
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

1 participant