On Sat, Jul 08, 2006 at 11:00:08PM -0700, Michael A. Schoen wrote:
> But just wondering if folks considered the performance impact of the 
> change? From a simple test it seems that BigDecimal math is about twice 
> as slow as using Floats.
As one of the main authors of the patch, I did test this, and found
this, and tried hard to ensure there wasn't any stupidity getting in the
way of usage of BigDecimal (see for example the example in the Ruby
stdlib for BigDecimal, which creates N new BigDecimals instead of
lifting the constant out of the loop). With the stupidity, on a worst
case (tight loop, with string to BigDecimal conversions every time),
there's a 110% slowdown. With the stupidity cleaned up some, it's much
lighter (50% or so), and conceivably less after BigDecimal gets cleaned
up a bit more (I'm working on a patch for Ruby BigDecimal itself still).

However more significantly, unless you mis-read the patch, :float is NOT
replaced with :decimal. It's merely supplemented. Using :float still
gets you the same old behavior in Rails.

-- 
Robin Hugh Johnson
E-Mail     : [EMAIL PROTECTED]
GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85

Attachment: pgpjpAqIG30Lb.pgp
Description: PGP signature

_______________________________________________
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core

Reply via email to