From: "S_H_ (Shun Hiraoka)" Date: 2022-10-23T05:58:14+00:00 Subject: [ruby-core:110487] [Ruby master Feature#19076] Improve performance Proc#parameters Issue #19076 has been updated by S_H_ (Shun Hiraoka). Sorry, I checked benchmark and it seems to always be slower then don't pass keyword arguments Therefore, you may close this ticket. ---------------------------------------- Feature #19076: Improve performance Proc#parameters https://bugs.ruby-lang.org/issues/19076#change-99807 * Author: S_H_ (Shun Hiraoka) * Status: Open * Priority: Normal ---------------------------------------- Improve performance `Proc#parameters` method(write in Ruby) benchmark: ```yml prelude: | prc = proc{|x, y=42, *other|} lam = lambda{|x, y=42, *other|} benchmark: proc_no_kwarg: | prc.parameters proc_given_kwarg: | prc.parameters(lambda: false) lambda_no_kwarg: | prc.parameters lambda_given_kwarg: | prc.parameters(lambda: false) loop_count: 20000000 ``` result: ```bash sh@DESKTOP-L0NI312:~/rubydev/build$ make benchmark/benchmark.yml -e BENCH_RUBY=../install/bin/ruby -e COMPARE_RUBY=~/.rbenv/shims/ruby ../ruby/revision.h unchanged compare-ruby: ruby 3.2.0dev (2022-10-22T10:34:00Z master 8dfe3bdf48) [x86_64-linux] built-ruby: ruby 3.2.0dev (2022-10-22T10:34:00Z improve_prom_param.. 8dfe3bdf48) [x86_64-linux] # Iteration per second (i/s) | |compare-ruby|built-ruby| |:-------------------|-----------:|---------:| |proc_no_kwarg | 4.559M| 3.944M| | | 1.16x| -| |proc_given_kwarg | 2.885M| 3.652M| | | -| 1.27x| |lambda_no_kwarg | 4.732M| 3.800M| | | 1.25x| -| |lambda_given_kwarg | 2.858M| 3.603M| | | -| 1.26x| ``` COMPARE_RUBY is `ruby 3.2.0dev (2022-10-22T10:34:00Z master 8dfe3bdf48) [x86_64-linux]`. BENCH_RUBY is ahead of `ruby 3.2.0dev (2022-10-22T10:34:00Z master 8dfe3bdf48) [x86_64-linux]`. pull request: https://github.com/ruby/ruby/pull/6617 -- https://bugs.ruby-lang.org/ Unsubscribe: