diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-02-13 17:49:15 -0800 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-02-13 17:49:15 -0800 |
commit | 1fd78305b5812c186d9eed9475677f90946eba5f (patch) | |
tree | a9142f38f0c93eebbbd2ddb5cea3803a14464c88 /activerecord/test/cases/date_time_test.rb | |
parent | f36b80b3e8a1aae9e45af7c82be3917bc6277aa1 (diff) | |
parent | 0c0ee13a1cb6a8156c7a3bf7334efc6ff8c04c5d (diff) | |
download | rails-1fd78305b5812c186d9eed9475677f90946eba5f.tar.gz rails-1fd78305b5812c186d9eed9475677f90946eba5f.tar.bz2 rails-1fd78305b5812c186d9eed9475677f90946eba5f.zip |
Merge pull request #9254 from warnickr/9253_avoid_bigdecimal_performance_issue
Before writing a numeric attribute value, ActiveRecord does an implicit conversion of boolean types (true => 1 and false => 0). If the numeric value being assigned is a BigDecimal, then ActiveRecord compares a BigDecimal to true and false.
This is known to be very slow in Ruby 1.9.3 (see http://www.ruby-forum.com/topic/4409452 and https://bugs.ruby-lang.org/issues/7645#change-35188).
The Ruby core team has implemented a fix for this issue that will be included in Ruby 2, but they appear to have no intention of back-porting this fix to Ruby 1.9.3. In my case, the performance impact of this issue was enormous (200% - 300% performance hit) for some of the pages in my application.
See c75b5a88a82c79fdf95dfea4d72bf3c5a829930e applied to 3-2-stable branch for more reasoning and a benchmark.
Diffstat (limited to 'activerecord/test/cases/date_time_test.rb')
0 files changed, 0 insertions, 0 deletions