Skip to content

Instantly share code, notes, and snippets.

@marcric
Created February 13, 2010 17:17
require 'benchmark'
string_test = Benchmark.measure do
3_000_000.times do
"ZigZag" == "ZigZag"
end
end.total
sym = Benchmark.measure do
3_000_000.times do
:ZigZag == :ZigZag
end
end.total
puts "String: " + string_test.to_s
puts "Symbol: " + sym.to_s
puts '==========='
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment