summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2022-11-17 09:47:18 -0500
committerPeter Zhu <peter@peterzhu.ca>2022-11-21 10:22:29 -0500
commit1f0888ab3e699a1083cddad84b0d8cb28e15ad8e (patch)
tree425b56eb1418cf8324f25d7d0cb4f7ff887183ed /eval.c
parent648927d71bde5df02a0490f5f45bb7fcde913376 (diff)
downloadruby-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 'eval.c')
0 files changed, 0 insertions, 0 deletions