From: gamelinks007@... Date: 2021-01-01T06:22:12+00:00 Subject: [ruby-core:101846] [Ruby master Feature#17498] Improve performance some Float methods Issue #17498 has been reported by S_H_ (Shun Hiraoka). ---------------------------------------- Feature #17498: Improve performance some Float methods https://bugs.ruby-lang.org/issues/17498 * Author: S_H_ (Shun Hiraoka) * Status: Open * Priority: Normal ---------------------------------------- Improve performance some Float methods(write in Ruby) benchmark: ```yml prelude: | flo = 4.2 benchmark: to_f: | flo.to_f abs: | flo.abs magnitude: | flo.magnitude -@: | -flo zero?: | flo.zero? loop_count: 20000000 ``` result: ```bash sh@DESKTOP-L0NI312:~/rubydev/build$ make benchmark/float_methods.yml -e BENCH_RUBY=../install/bin/ruby -e COMPARE_RUBY=~/.rbenv/shims/ruby # Iteration per second (i/s) | |compare-ruby|built-ruby| |:----------|-----------:|---------:| |to_f | 60.880M| 81.272M| | | -| 1.33x| |abs | 68.162M| 81.264M| | | -| 1.19x| |magnitude | 53.441M| 78.829M| | | -| 1.48x| |-@ | 67.193M| 84.731M| | | -| 1.26x| |zero? | 69.894M| 82.032M| | | -| 1.17x| ``` `COMPARE_RUBY` is `ruby 3.1.0dev (2020-12-31T22:55:59Z master 3d7f71801a) [x86_64-linux]`. `BENCH_RUBY` is ahead of `ruby 3.1.0dev (2020-12-31T22:55:59Z master 3d7f71801a) [x86_64-linux]`. -- https://bugs.ruby-lang.org/ Unsubscribe: