Add benchmark for implicit array/hash allocation reduction changes

Benchmark results:

```
named_multi_arg_splat
after:    5344097.6 i/s
before:   3088134.0 i/s - 1.73x  slower

named_post_splat
after:    5401882.3 i/s
before:   2629321.8 i/s - 2.05x  slower

anon_arg_splat
after:   12242780.9 i/s
before:   6845413.2 i/s - 1.79x  slower

anon_arg_kw_splat
after:   11277398.7 i/s
before:   4329509.4 i/s - 2.60x  slower

anon_multi_arg_splat
after:    5132699.5 i/s
before:   3018103.7 i/s - 1.70x  slower

anon_post_splat
after:    5602915.1 i/s
before:   2645185.5 i/s - 2.12x  slower

anon_kw_splat
after:   15403727.3 i/s
before:   6249504.6 i/s - 2.46x  slower

anon_fw_to_named_splat
after:    2985715.3 i/s
before:   2049159.9 i/s - 1.46x  slower

anon_fw_to_named_no_splat
after:    2941030.4 i/s
before:   2100380.0 i/s - 1.40x  slower

fw_to_named_splat
after:    2801008.7 i/s
before:   2012416.4 i/s - 1.39x  slower

fw_to_named_no_splat
after:    2742670.4 i/s
before:   1957707.2 i/s - 1.40x  slower

fw_to_anon_to_named_splat
after:    2309246.6 i/s
before:   1375924.6 i/s - 1.68x  slower

fw_to_anon_to_named_no_splat
after:    2193227.6 i/s
before:   1351184.1 i/s - 1.62x  slower
```
This commit is contained in:
Jeremy Evans 2023-12-14 16:48:09 -08:00
Родитель 4f77d8d328
Коммит 42d891be2c
1 изменённых файлов: 25 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,25 @@
prelude: |
def named_arg_splat(*a) end
def named_arg_kw_splat(*a, **kw) end
def anon_arg_splat(*) end
def anon_kw_splat(**) end
def anon_arg_kw_splat(*, **) end
def anon_fw_to_named(*, **) named_arg_kw_splat(*, **) end
def fw_to_named(...) named_arg_kw_splat(...) end
def fw_to_anon_to_named(...) anon_fw_to_named(...) end
a = [1]
kw = {y: 1}
benchmark:
named_multi_arg_splat: "named_arg_splat(*a, *a)"
named_post_splat: "named_arg_splat(*a, a)"
anon_arg_splat: "anon_arg_splat(*a)"
anon_arg_kw_splat: "anon_arg_kw_splat(*a, **kw)"
anon_multi_arg_splat: "anon_arg_splat(*a, *a)"
anon_post_splat: "anon_arg_splat(*a, a)"
anon_kw_splat: "anon_kw_splat(**kw)"
anon_fw_to_named_splat: "anon_fw_to_named(*a, **kw)"
anon_fw_to_named_no_splat: "anon_fw_to_named(1, y: 1)"
fw_to_named_splat: "fw_to_named(*a, **kw)"
fw_to_named_no_splat: "fw_to_named(1, y: 1)"
fw_to_anon_to_named_splat: "fw_to_anon_to_named(*a, **kw)"
fw_to_anon_to_named_no_splat: "fw_to_anon_to_named(1, y: 1)"