[#67346] Future of test suites for Ruby — Charles Oliver Nutter <headius@...>

I'll try to be brief so we can discuss all this. tl;dr: RubySpec is

19 messages 2015/01/05

[ruby-core:67912] [ruby-trunk - Feature #10800] [PRRF][PATCH] Make math.c twice as faster when passed Bignum

From: mail@...
Date: 2015-01-30 20:46:38 UTC
List: ruby-core #67912
Issue #10800 has been updated by gogo tanaka.


Hi! After r49449, I found math.c become 5.7 times faster than before.
note: in a certain case (`Math.atan2 ` with `Fixnum`)

In almost all case, every function become about 3 times faster than before.

(And now Ruby's math module faster than python's one in my benchmark, but w=
e don=E2=80=99t need to care about it so much)

# math.c with Fixnum(1)
```
:Func    :Before(s)            :After(s)             :Before/After(s/s)    =
     (:python 3.4.2_1)
cos      4.254130927001825     1.4405686919926666    2.9530913386138486 tim=
es   (2.5527)
sin      4.291027050989214     1.4243739590019686    3.012570556959532  tim=
es   (2.6044)
tan      5.363125992007554     1.483381660989835     3.6154727627068226 tim=
es   (2.7025)
atan2    7.793055543996161     1.355327188008232     5.749944082099257  tim=
es   (2.3252)
acos     4.32658559900301      1.2158808639942436    3.55839599678369   tim=
es   (2.3867)
asin     4.435602433994063     1.186041908003972     3.7398361761591388 tim=
es   (2.5280)
atan     5.748181078990456     1.365189026997541     4.210538588661546  tim=
es   (3.5160)
cosh     4.990852664006525     1.2583572969888337    3.9661649961813765 tim=
es   (2.4602)
sinh     4.523930807001307     1.29845637800463      3.4840837810457232 tim=
es   (2.5097)
tanh     4.194435634999536     1.262307046999922     3.322833097516404  tim=
es   (2.4466)
acosh    4.406813007997698     1.236766300004092     3.5631735825783073 tim=
es   (2.5998)
asinh    4.644120037002722     1.7610739079973428    2.637095476750275  tim=
es   (2.9141)
atanh    4.88491953999619      1.5865220309933648    3.079011475773588  tim=
es   (2.0711)
exp      4.4360210559971165    1.262295284002903     3.514249884488133  tim=
es   (2.3970)
log      8.53709495300427      2.3806999689986696    3.585960038717101  tim=
es   (3.8041)
log2     4.5818921600002795    1.3234373809973476    3.4621148123739314 tim=
es   (2.2458)
log10    4.361282436992042     1.306003783000051     3.339410263401872  tim=
es   (2.2278)
sqrt     4.195985846003168     1.1582538549992023    3.6226823920271416 tim=
es   (2.2647)
cbrt     4.281482355989283     1.3084301960043376    3.272228330608696  tim=
es
frexp    4.681357052002568     1.7626637079956708    2.6558424223334978 tim=
es   (3.7055)
ldexp    4.358438926996314     1.3060880839911988    3.3370176027313665 tim=
es   (3.7046)
hypot    7.374471293005627     1.348440486995969     5.468888960338427  tim=
es   (3.7265)
erf      4.596977610999602     1.6560243620042456    2.7759118262221656 tim=
es   (5.6961)
erfc     4.516037146997405     1.5825385909993201    2.8536663640825837 tim=
es   (5.7214)
gamma    4.0430225580057595    1.194721624997328     3.3840707939096704 tim=
es   (6.6276)
lgamma   4.750712952998583     1.8684836480097147    2.542549921728768  tim=
es   (9.2180)
```

I leave code which measures this benchmark here(https://gist.github.com/gog=
otanaka/379b00397d494a2b22d2)

I'm gonna do same thing for `Rational` and produce more proper and general =
benchmark.


----------------------------------------
Feature #10800: [PRRF][PATCH] Make math.c twice as faster when passed Bignum
https://bugs.ruby-lang.org/issues/10800#change-51309

* Author: gogo tanaka
* Status: Closed
* Priority: Normal
* Assignee:=20
----------------------------------------
This ticket is  continued from [Feature 10785](https://bugs.ruby-lang.org/i=
ssues/10785)

My patch last time is only for Fixnum, but now I'd like to do same thing fo=
r Bignum without loosing others performance.

And this time I follow [r49434](https://bugs.ruby-lang.org/projects/ruby-tr=
unk/repository/revisions/49434) not to ignore redefinition of Integer#to_f =
;)

thanks.

---Files--------------------------------
introduce_num2dbl_with_to_f_func.patch (7.38 KB)
fix_indent_for_MISC_10800.patch (683 Bytes)


--=20
https://bugs.ruby-lang.org/

In This Thread

Prev Next