[pull] master from ruby:master#847
Merged
pull[bot] merged 7 commits intoturkdevops:masterfrom Mar 13, 2026
Merged
Conversation
Apple's libc implementation of memmem is super slow (it is a forked version of freebsd's that never got vectorized). Instead, we should fall back to the rolling hash on Apple. In the attached benchmark, I'm seeing 1.07% slower to 30.34% slower, depending on the haystack. For reference, here are the various implementations I checked: * musl: https://git.musl-libc.org/cgit/musl/tree/src/string/memmem.c * freebsd: https://github.com/freebsd/freebsd-src/blob/main/lib/libc/string/memmem.c * apple: https://github.com/apple-oss-distributions/Libc/blob/main/string/FreeBSD/memmem.c You can see Apple just linearly searches through the string and calls memcmp each time, whereas the other two do a window'd rolling hash similar to the fallback Ruby already has.
Prevent GC from accidentally collecting
This test should be redesigned, but increasing the timeout should probably be good enough for now to not see CI failures related to it. I can see how this could timeout after 10s. Failing test after 10s timeout: https://ci.rvm.jp/results/trunk_gcc10@ruby-sp2-noble-docker/6247393 According to the stack trace at time of abort, there was no deadlock and it was in the middle of a GC. Everything looks fine. This is assuming the fatal signal came from `EnvUtil.terminate`.
….java * TRUFFLERUBY_METRICS_REPS=5 jt metrics time --experimental-options -e0 For parsing-core: before: 0.097 0.099 0.092 0.096 after: 0.061 0.063 0.066 0.059 * Remove extra trailing spaces by using `<%-#`. ruby/prism@e08b47e26c
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )