Last active
June 20, 2019 12:42
-
-
Save motchang/ac3ab76c3e7060e969356d8374cac22a to your computer and use it in GitHub Desktop.
big set
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 'set' | |
require 'benchmark' | |
Benchmark.bm 10 do |r| | |
limit = 65535*1000 | |
r.report "to_a" do | |
(1..limit).to_a | |
end | |
r.report "to_set" do | |
(1..limit).to_set | |
end | |
end |
Author
motchang
commented
Jun 20, 2019
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment