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
|