diff options
author | Peter Zhu <peter@peterzhu.ca> | 2022-11-17 09:47:18 -0500 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2022-11-21 10:22:29 -0500 |
commit | 1f0888ab3e699a1083cddad84b0d8cb28e15ad8e (patch) | |
tree | 425b56eb1418cf8324f25d7d0cb4f7ff887183ed /yjit | |
parent | 648927d71bde5df02a0490f5f45bb7fcde913376 (diff) | |
download | ruby-1f0888ab3e699a1083cddad84b0d8cb28e15ad8e.tar.gz |
Speed up shape transitions
This commit significantly speeds up shape transitions as it changes
get_next_shape_internal to not perform a lookup (and instead require
the caller to perform the lookup). This avoids double lookups during
shape transitions.
There is a significant (~2x) speedup in the following micro-benchmark:
puts(Benchmark.measure do
o = Object.new
100_000.times do |i|
o.instance_variable_set(:"@a#{i}", 0)
end
end)
Before:
22.393194 0.201639 22.594833 ( 22.684237)
After:
11.323086 0.022284 11.345370 ( 11.389346)
Diffstat (limited to 'yjit')
0 files changed, 0 insertions, 0 deletions