Last active
June 22, 2016 10:49
-
-
Save amitpatelx/dd6dd3852257027b099a9961f64ad47e to your computer and use it in GitHub Desktop.
Comparing Array#max time between Ruby 2.4.0-preview1 and 2.3.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2.3.0 :001 > require 'benchmark' | |
=> true | |
2.3.0 :002 > x, y = 1, 2; | |
2.3.0 :003 > puts Benchmark.measure { 10000000.times { [x, y].max } } | |
3.300000 0.000000 3.300000 ( 3.301698) | |
=> nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2.4.0-preview1 :001 > require 'benchmark' | |
=> true | |
2.4.0-preview1 :002 > x, y = 1, 2; | |
2.4.0-preview1 :003 > puts Benchmark.measure { 10000000.times { [x, y].max } } | |
0.560000 0.000000 0.560000 ( 0.570256) | |
=> nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment