Project

General

Profile

Actions

Feature #17632

closed

Improve performance some Numeric methods

Added by S_H_ (Shun Hiraoka) about 3 years ago. Updated about 3 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:102529]

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 #1

Updated by S_H_ (Shun Hiraoka) about 3 years ago

  • Status changed from Open to Closed

Applied in changeset git|efd19badf43f4f1f24d5aec8a28e94a6e1e47b5b.


Improve performance some Numeric methods [Feature #17632] (#4190)

Actions

Also available in: Atom PDF

Like0
Like0