ruby/benchmark/vm_zsuper_splat_calls.yml
Jeremy Evans f446d68ba6 Add benchmarks for super and zsuper calls of different types
These show gains from the recent optimization commits:

```
                        arg_splat
            miniruby:   7346039.9 i/s
     miniruby-before:   4692240.8 i/s - 1.57x  slower

                  arg_splat_block
            miniruby:   6539749.6 i/s
     miniruby-before:   4358063.6 i/s - 1.50x  slower

                   splat_kw_splat
            miniruby:   5433641.5 i/s
     miniruby-before:   3851048.6 i/s - 1.41x  slower

             splat_kw_splat_block
            miniruby:   4916137.1 i/s
     miniruby-before:   3477090.1 i/s - 1.41x  slower

                   splat_kw_block
            miniruby:   2912829.5 i/s
     miniruby-before:   2465611.7 i/s - 1.18x  slower

                   arg_splat_post
            miniruby:   2195208.2 i/s
     miniruby-before:   1860204.3 i/s - 1.18x  slower
```

zsuper only speeds up in the post argument case, because
it was already set to use splatarray false in cases where
there were no post arguments.
2024-03-01 07:10:25 -08:00

28 lines
1.2 KiB
YAML

prelude: |
a = [1].freeze
ea = [].freeze
kw = {y: 1}.freeze
b = lambda{}
extend(Module.new{def arg_splat(x=0, y: 0) end})
extend(Module.new{def arg_splat_block(x=0, y: 0) end})
extend(Module.new{def arg_splat_post(x=0, y: 0) end})
extend(Module.new{def splat_kw_splat(x=0, y: 0) end})
extend(Module.new{def splat_kw_splat_block(x=0, y: 0) end})
extend(Module.new{def splat_kw(x=0, y: 0) end})
extend(Module.new{def splat_kw_block(x=0, y: 0) end})
extend(Module.new{def arg_splat(x, *a) super end})
extend(Module.new{def arg_splat_block(x, *a, &b) super end})
extend(Module.new{def arg_splat_post(*a, x) super end})
extend(Module.new{def splat_kw_splat(*a, **kw) super end})
extend(Module.new{def splat_kw_splat_block(*a, **kw, &b) super end})
extend(Module.new{def splat_kw(*a, y: 1) super end})
extend(Module.new{def splat_kw_block(*a, y: 1, &b) super end})
benchmark:
arg_splat: "arg_splat(1, *ea)"
arg_splat_block: "arg_splat_block(1, *ea, &b)"
arg_splat_post: "arg_splat_post(1, *ea, &b)"
splat_kw_splat: "splat_kw_splat(*a, **kw)"
splat_kw_splat_block: "splat_kw_splat_block(*a, **kw, &b)"
splat_kw: "splat_kw(*a, y: 1)"
splat_kw_block: "splat_kw_block(*a, y: 1, &b)"