Created
April 12, 2018 23:56
-
-
Save briankung/dc66c68f4395b70220571eb0f46c1ac7 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 'benchmark' | |
Benchmark.bm do |x| | |
arr = Array.new(1_000_000) { rand(1...9) } | |
x.report { 500.times { arr.uniq } } | |
x.report { 500.times { arr & arr } } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment