List Info

Thread: 1.9 and 1.8.6: Fixnum#gcd(Fixnum) improves performance of Date, Rational.




1.9 and 1.8.6: Fixnum#gcd(Fixnum) improves performance of Date, Rational.
country flaguser name
United States
2008-03-22 19:31:34
Can this be added to 1.8.7 and trunk?

* numeric.c (gcd): Added Fixnum#gcd(Fixnum) support in C.
Date uses Rational heavily, which calls Integer#gcd for
every new
Rational.  The Integer#gcd method is generic to handle
Bignums,
but performs terribly for Fixnum#gcd(Fixnum),
which is probably the most often case.

The 1.8.6 patch improves Fixnum#gcd performance by 1000%.
The 1.9 patch improves Fixnum#gcd performance by 300%.

See
http://rubyforge.org/track
er/?func=detail&aid=19034&group_id=426&atid=1698


Thanks,
Kurt Stephens
http://kurtstephens.com



  
  
  
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )