We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dup
It's one less allocation, too :)
Set.new.compare_by_identity
S.dup
Hash.new.compare_by_identity
H.dup
S = Set.new.compare_by_identity.freeze H = Hash.new.compare_by_identity.freeze Benchmark.ips do |x| x.config(time: 10) x.report(".new.compare_by_identity") do |times| i = 0 while (i += 1) <= times S.dup end end x.report(".dup ") do |times| i = 0 while (i += 1) <= times Set.new.compare_by_identity end end x.compare! end Benchmark.ips do |x| x.config(time: 10) x.report(".new.compare_by_identity") do |times| i = 0 while (i += 1) <= times H.dup end end x.report(".dup ") do |times| i = 0 while (i += 1) <= times Hash.new.compare_by_identity end end x.compare! end
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It's one less allocation, too :)
Set.new.compare_by_identity
S.dup
Hash.new.compare_by_identity
H.dup
The text was updated successfully, but these errors were encountered: