aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/callbacks.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2013-12-11 23:25:17 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2013-12-11 23:32:33 -0700
commit864b92cd25d70bb623d43dbe3b28488c93885e61 (patch)
treedea314ae5268ffa452d1a91a0da395c5501c875c /activesupport/lib/active_support/callbacks.rb
parentebfd97124db0cd7550dd197559343e2fda5b79d6 (diff)
downloadrails-864b92cd25d70bb623d43dbe3b28488c93885e61.tar.gz
rails-864b92cd25d70bb623d43dbe3b28488c93885e61.tar.bz2
rails-864b92cd25d70bb623d43dbe3b28488c93885e61.zip
JSON: speed up date/time encoding
Comparing dates & times with other objects using #== is slow. Internally, it hits #<=> which calls #to_datetime on objects that don't respond to it, so we incur the cost of raising an exception with a possibly-deep backtrace. Cost of #jsonify on a Time object: Calculating ------------------------------------- old 3644 i/100ms new 12652 i/100ms ------------------------------------------------- old 43373.8 (±3.5%) i/s - 218640 in 5.047017s new 173437.6 (±5.2%) i/s - 872988 in 5.047747s
Diffstat (limited to 'activesupport/lib/active_support/callbacks.rb')
0 files changed, 0 insertions, 0 deletions