Subscribed unsubscribe Subscribe Subscribe

もう一個面白かったやつ

irb(main):007:0> require 'benchmark'
=> true
irb(main):008:0> require 'bigdecimal'
=> true
irb(main):009:0> n = 1000
=> 1000
irb(main):011:0> Benchmark.realtime { n.times { BigDecimal('3') == true } }
=> 0.023832
irb(main):010:0>  Benchmark.realtime { n.times { BigDecimal('3').is_a?(TrueClass) } }
=> 0.001259

https://github.com/rails/rails/commit/1fd78305b5812c186d9eed9475677f90946eba5f