[pull] master from ruby:master - #1404
Merged
Merged
Conversation
The autoconf-20260320-1 package replaced /usr/bin/autoreconf with a wrapper that fails with a shell syntax error on every call, so run the versioned binary directly. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit changes Array#| to use a temporary Set instead of Hash for
performance and memory savings. We can see in the following benchmark:
a = (0...10_000).to_a
b = (5_000...15_000).to_a
1_000.times { a | b }
Results:
Benchmark 1: master
Time (mean ± σ): 237.5 ms ± 2.0 ms [User: 223.4 ms, System: 10.9 ms]
Range (min … max): 234.6 ms … 240.7 ms 12 runs
Benchmark 2: branch
Time (mean ± σ): 165.2 ms ± 3.8 ms [User: 151.2 ms, System: 10.8 ms]
Range (min … max): 159.8 ms … 174.2 ms 18 runs
Summary
branch ran
1.44 ± 0.04 times faster than master
This commit changes Array#union to use a temporary Set instead of Hash for
performance and memory savings. We can see in the following benchmark:
a = (0...10_000).to_a
b = (5_000...15_000).to_a
1_000.times { a.union(b) }
Results:
Benchmark 1: master
Time (mean ± σ): 239.9 ms ± 3.5 ms [User: 224.9 ms, System: 11.7 ms]
Range (min … max): 234.8 ms … 246.0 ms 12 runs
Benchmark 2: branch
Time (mean ± σ): 165.5 ms ± 4.1 ms [User: 150.9 ms, System: 11.5 ms]
Range (min … max): 158.9 ms … 174.0 ms 18 runs
Summary
branch ran
1.45 ± 0.04 times faster than master
This commit changes Array#- to use a temporary Set instead of Hash for
performance and memory savings. We can see in the following benchmark:
a = (0...10_000).to_a
b = (5_000...15_000).to_a
1_000.times { a - b }
Results:
Benchmark 1: master
Time (mean ± σ): 200.3 ms ± 3.8 ms [User: 188.0 ms, System: 9.4 ms]
Range (min … max): 194.1 ms … 206.8 ms 14 runs
Benchmark 2: branch
Time (mean ± σ): 170.7 ms ± 6.6 ms [User: 158.7 ms, System: 9.3 ms]
Range (min … max): 160.9 ms … 183.7 ms 17 runs
Summary
branch ran
1.17 ± 0.05 times faster than master
This commit changes Array#difference to use a temporary Set instead of Hash for
performance and memory savings. We can see in the following benchmark:
a = (0...10_000).to_a
b = (5_000...15_000).to_a
1_000.times { a.difference(b) }
Results:
Benchmark 1: master
Time (mean ± σ): 192.2 ms ± 7.1 ms [User: 179.7 ms, System: 9.0 ms]
Range (min … max): 182.4 ms … 208.9 ms 15 runs
Benchmark 2: branch
Time (mean ± σ): 168.1 ms ± 4.7 ms [User: 156.5 ms, System: 8.5 ms]
Range (min … max): 160.2 ms … 174.6 ms 17 runs
Summary
branch ran
1.14 ± 0.05 times faster than master
This commit changes Array#& to use a temporary Set instead of Hash for
performance and memory savings. We can see in the following benchmark:
a = (0...10_000).to_a
b = (5_000...15_000).to_a
1_000.times { a & b }
Results:
Benchmark 1: master
Time (mean ± σ): 196.4 ms ± 9.1 ms [User: 182.9 ms, System: 9.5 ms]
Range (min … max): 186.3 ms … 214.7 ms 13 runs
Benchmark 2: branch
Time (mean ± σ): 163.4 ms ± 3.3 ms [User: 152.7 ms, System: 7.8 ms]
Range (min … max): 157.7 ms … 169.9 ms 17 runs
Summary
branch ran
1.20 ± 0.06 times faster than master
This commit changes Array#intersect? to use a temporary Set instead of Hash for
performance and memory savings. We can see in the following benchmark:
a = (0...10_000).to_a
b = (5_000...15_000).to_a
1_000.times { a.intersect?(b) }
Results:
Benchmark 1: master
Time (mean ± σ): 126.8 ms ± 3.8 ms [User: 115.5 ms, System: 8.9 ms]
Range (min … max): 120.9 ms … 134.2 ms 22 runs
Benchmark 2: branch
Time (mean ± σ): 99.3 ms ± 3.5 ms [User: 89.4 ms, System: 7.6 ms]
Range (min … max): 94.1 ms … 109.7 ms 29 runs
Summary
branch ran
1.28 ± 0.06 times faster than master
This commit changes Array#uniq to use a temporary Set instead of Hash for
performance and memory savings. We can see in the following benchmark:
a = (0...10_000).to_a + (0...10_000).to_a
1_000.times { a.uniq }
Results:
Benchmark 1: master
Time (mean ± σ): 194.6 ms ± 4.9 ms [User: 183.2 ms, System: 8.7 ms]
Range (min … max): 187.5 ms … 205.1 ms 15 runs
Benchmark 2: branch
Time (mean ± σ): 147.2 ms ± 4.0 ms [User: 134.9 ms, System: 9.5 ms]
Range (min … max): 139.2 ms … 153.4 ms 20 runs
Summary
branch ran
1.32 ± 0.05 times faster than master
This commit changes Array#uniq! to use a temporary Set instead of Hash for
performance and memory savings. We can see in the following benchmark:
a = (0...10_000).to_a + (0...10_000).to_a
1_000.times { a.dup.uniq! }
Results:
Benchmark 1: master
Time (mean ± σ): 242.1 ms ± 3.9 ms [User: 229.6 ms, System: 9.6 ms]
Range (min … max): 235.7 ms … 248.3 ms 12 runs
Benchmark 2: branch
Time (mean ± σ): 197.4 ms ± 6.1 ms [User: 184.2 ms, System: 10.4 ms]
Range (min … max): 185.9 ms … 204.5 ms 14 runs
Summary
branch ran
1.23 ± 0.04 times faster than master
The delay in `test_mode_settings` was stored as a raw VALUE, so a delay of n milliseconds slept for 2n+1. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Save `timeout` in a volatile pointer before `EC_EXEC_TAG` to avoid
GCC 15.3.0's `-Wclobbered` warning on aarch64-linux.
```
../src/thread.c: In function ‘thread_io_wait’:
../src/thread.c:4915:87: warning: argument ‘timeout’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
4915 | thread_io_wait(rb_thread_t *th, struct rb_io *io, int fd, int events, struct timeval *timeout)
| ~~~~~~~~~~~~~~~~^~~~~~~
```
This commit changes Enumerable#uniq to use a temporary Set instead of Hash
for performance and memory savings. We can see in the following benchmark:
a = ((0...10_000).to_a + (0...10_000).to_a).each
1_000.times { a.uniq }
Results:
Benchmark 1: master
Time (mean ± σ): 222.4 ms ± 3.7 ms [User: 212.4 ms, System: 7.6 ms]
Range (min … max): 216.9 ms … 227.6 ms 13 runs
Benchmark 2: branch
Time (mean ± σ): 189.7 ms ± 4.0 ms [User: 177.7 ms, System: 9.2 ms]
Range (min … max): 182.8 ms … 198.6 ms 15 runs
Summary
branch ran
1.17 ± 0.03 times faster than master
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 : )