Actions
Feature #17632
closedImprove performance some Numeric methods
Status:
Closed
Assignee:
-
Target version:
-
Description
Improve performance some Nuemric
methods(write in Ruby)
benchmark:
prelude: |
int = 42
flo = 4.2
benchmark:
real?: |
int.real?
integer?: |
flo.integer?
finite?: |
int.finite?
infinite?: |
int.infinite?
loop_count: 20000000
result:
sh@DESKTOP-L0NI312:~/rubydev/build$ make benchmark/numeric_methods.yml -e COMPARE_RUBY=~/.rbenv/shims/ruby -e BENCH_RUBY=../install/bin/ruby
generating vm_call_iseq_optimized.inc
vm_call_iseq_optimized.inc unchanged
compare-ruby: ruby 3.1.0dev (2021-02-15T09:29:35Z master 37b90bcdc1) [x86_64-linux]
built-ruby: ruby 3.1.0dev (2021-02-15T13:18:32Z improve_numeric_me.. 349c5721ad) [x86_64-linux]
last_commit=Improve Numeric methods
# Iteration per second (i/s)
| |compare-ruby|built-ruby|
|:----------|-----------:|---------:|
|real? | 90.157M| 106.604M|
| | -| 1.18x|
|integer? | 93.559M| 105.397M|
| | -| 1.13x|
|finite? | 90.229M| 104.325M|
| | -| 1.16x|
|infinite? | 89.233M| 113.647M|
| | -| 1.27x|
COMPARE_RUBY
is ruby 3.1.0dev (2021-02-15T09:29:35Z master 37b90bcdc1) [x86_64-linux]
. BENCH_RUBY is ahead of ruby 3.1.0dev (2021-02-15T09:29:35Z master 37b90bcdc1) [x86_64-linux]
.
pull request:
https://github.com/ruby/ruby/pull/4190
Actions
Like0
Like0