Skip to content

Instantly share code, notes, and snippets.

@marcric
Created February 13, 2010 17:16
Show Gist options
  • Save marcric/303569 to your computer and use it in GitHub Desktop.
Save marcric/303569 to your computer and use it in GitHub Desktop.
require 'benchmark'
string_test = Benchmark.measure do
6_000_000.times do
"test"
end
end.total
symbol_test = Benchmark.measure do
6_000_000.times do
:test
end
end.total
puts "String: " + string_test.to_s
puts "Symbol: " + symbol_test.to_s
puts '==========='
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment