ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:101846] [Ruby master Feature#17498] Improve performance some Float methods
@ 2021-01-01  6:22 gamelinks007
  0 siblings, 0 replies; only message in thread
From: gamelinks007 @ 2021-01-01  6:22 UTC (permalink / raw
  To: ruby-core

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/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-01  6:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-01  6:22 [ruby-core:101846] [Ruby master Feature#17498] Improve performance some Float methods gamelinks007

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).