Skip to content

Instantly share code, notes, and snippets.

@spajus
Created July 7, 2013 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spajus/5942878 to your computer and use it in GitHub Desktop.
Save spajus/5942878 to your computer and use it in GitHub Desktop.
vars = Object.methods
Benchmark.realtime { 100000.times { vars.map { |var| var.to_s } } }
=> 2.04459
Benchmark.realtime { 100000.times { vars.map { |var| var.to_s } } }
=> 2.048889
Benchmark.realtime { 100000.times { vars.map(&:to_s) } }
=> 1.917303
Benchmark.realtime { 100000.times { vars.map(&:to_s) } }
=> 1.944543
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment