Skip to content

Instantly share code, notes, and snippets.

@marten
Created April 28, 2011 09:22
Show Gist options
  • Save marten/946079 to your computer and use it in GitHub Desktop.
Save marten/946079 to your computer and use it in GitHub Desktop.
require 'benchmark'
arr = (1..1000000).map { rand };
Benchmark.bm(1000) do |x|
x.report("&:symbol") { arr.map(&:to_s); }
x.report("lambda") { arr.map{|i| i.to_s }; }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment