Created
January 20, 2016 05:03
-
-
Save bethsecor/f792ce198e69d277781f to your computer and use it in GitHub Desktop.
This file contains 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
require 'better-benchmark' | |
@data = (1..100).to_a | |
result = Benchmark.compare_realtime( | |
:iterations => 30, | |
:inner_iterations => 500_000, | |
:warmup_iterations => 1, | |
:verbose => true | |
) { |iteration| | |
@data.shuffle! | |
}.with { |iteration| | |
@data.shuffle | |
} | |
Benchmark.report_on result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment