From: "S_H_ (Shun Hiraoka)" Date: 2022-10-26T13:04:30+00:00 Subject: [ruby-core:110516] [Ruby master Feature#19085] Improve performance some Integer and Float methods Issue #19085 has been reported by S_H_ (Shun Hiraoka). ---------------------------------------- Feature #19085: Improve performance some Integer and Float methods https://bugs.ruby-lang.org/issues/19085 * Author: S_H_ (Shun Hiraoka) * Status: Open * Priority: Normal ---------------------------------------- Improve performance some `Integer` and `Float` methods written by Ruby. benchmark: ```yml prelude: | int_num = 42 flo_num = 4.2 benchmark: integer_real: | int_num.real float_real: | flo_num.real integr_imag: | int_num.imag float_imag: | flo_num.imag integer_conj: | int_num.conj float_conj: | flo_num.conj integer_numerator: | int_num.numerator integer_denominator: | int_num.denominator 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-26T06:02:04Z master 94f3aa2126) [x86_64-linux] built-ruby: ruby 3.2.0dev (2022-10-26T12:38:10Z improve_integer_an.. 2044b65fb2) [x86_64-linux] # Iteration per second (i/s) | |compare-ruby|built-ruby| |:--------------------|-----------:|---------:| |integer_real | 79.510M| 82.640M| | | -| 1.04x| |float_real | 80.673M| 83.534M| | | -| 1.04x| |integr_imag | 81.043M| 86.709M| | | -| 1.07x| |float_imag | 80.303M| 80.680M| | | -| 1.00x| |integer_conj | 78.219M| 85.795M| | | -| 1.10x| |float_conj | 75.137M| 84.604M| | | -| 1.13x| |integer_numerator | 78.194M| 79.461M| | | -| 1.02x| |integer_denominator | 73.674M| 87.035M| | | -| 1.18x| ``` `COMPARE_RUBY` is `ruby 3.2.0dev (2022-10-26T06:02:04Z master 94f3aa2126) [x86_64-linux]`. `BENCH_RUBY` is ahead of `ruby 3.2.0dev (2022-10-26T06:02:04Z master 94f3aa2126) [x86_64-linux]`. pull request: https://github.com/ruby/ruby/pull/6638 -- https://bugs.ruby-lang.org/ Unsubscribe: