Commit 07ef97d
authored
Fetch the execution context once in Array#each (#18610)
rb_yield() calls GET_EC() on every element, which on arm64 is an
out-of-line call to rb_current_ec() (RB_THREAD_CURRENT_EC_NOINLINE).
Hoist it out of the loop and use rb_ec_yield(), as ff831eb does
for Mutex#synchronize.
benchmark/loop_each.yml: 1.16x on arm64-darwin, 1.05x on aarch64-linux.1 parent 8568294 commit 07ef97d
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2786 | 2786 | | |
2787 | 2787 | | |
2788 | 2788 | | |
| 2789 | + | |
2789 | 2790 | | |
2790 | | - | |
| 2791 | + | |
2791 | 2792 | | |
2792 | 2793 | | |
2793 | 2794 | | |
| |||
0 commit comments