Skip to content

More string interpolation optimizations#8236

Merged
headius merged 1 commit intojruby:9.5-devfrom
headius:more_string_interpolation_optz
May 14, 2024
Merged

More string interpolation optimizations#8236
headius merged 1 commit intojruby:9.5-devfrom
headius:more_string_interpolation_optz

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
@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.

1 participant