That's a fair point. The ruby-bench results do not demonstrate the usefulness of the feature itself, since those workloads don't appear to exercise non-embeddable middle substrings in any significant way. SHARABLE\_MIDDLE\_SUBSTRING only...himura467 (Akito Shitara)
I wrote some micro-benchmarks targeting the patterns most affected by `SHARABLE_MIDDLE_SUBSTRING`. Environment: arm64-darwin25. current: https://github.com/himura467/ruby/tree/rstring-raw-ptr-explicit-length-ops Ref: https://github.co...himura467 (Akito Shitara)
byroot (Jean Boussier) wrote in #note-48: > as it's a new contention point for Ractors, and if the main thread fork while a background ractor is holding this lock, the child will likely end up deadlocking at some point. That's a valid c...himura467 (Akito Shitara)
byroot (Jean Boussier) wrote in #note-46: > If `RSTRING_PTR` never allocates, it means it doesn't provide NUL termination anymore, right? Regardless of whether it's the optimal approach, I think an implementation like https://github....himura467 (Akito Shitara)
mame (Yusuke Endoh) wrote in #note-43: > Please provide a quantitative evaluation of performance and compatibility at the application level. Does this change bring an observable performance improvement? Does memory usage increase or dec...himura467 (Akito Shitara)
IMO, backward compatibility of `RSTRING_PTR` should be preserved within the scope of this feature. Eregon (Benoit Daloze) wrote in #note-30: > I' believe migrating usages of `RSTRING_PTR()` which want `\0`-terminated to `StringValueC...himura467 (Akito Shitara)
rhenium (Kazuki Yamaguchi) wrote in #note-23: > I wonder if `RSTRING_PTR()` could instead allocate a read-only copy dedicated for `RSTRING_PTR()`, rather than permanently converting the String away from `STR_SHARED`. Interesting. The...himura467 (Akito Shitara)
Eregon (Benoit Daloze) wrote in #note-22: > What's the problem? If `RSTRING_END()` remains unchanged, it can cause inconsistency due to the undefined evaluation order of C. This happens if `RSTRING_END()` is evaluated before `RSTRIN...himura467 (Akito Shitara)
* [Feature #19315] Lazy substrings in CRuby * I created a prototype implementation: https://github.com/ruby/ruby/pull/17045 * This is also a prerequisite for [Feature #22056]. * Proposed approach: * Keep `RSTRING_PTR()` behavio...himura467 (Akito Shitara)