Skip to content

Instantly share code, notes, and snippets.

@aaronblohowiak
Created February 16, 2012 23:06
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 aaronblohowiak/1848613 to your computer and use it in GitHub Desktop.
Save aaronblohowiak/1848613 to your computer and use it in GitHub Desktop.
microbenchmarks are dumb
require 'rubygems'
require 'tach'
Tach.meter(1_000_000) do
tach('double') do
"path"
end
tach('single') do
'path'
end
tach('double double toil and trouble') do
"path"
end
end
#~/ #>jruby tmp.rb
#
# [double, single, double double toil and trouble]
#
# +--------------------------------+----------+
# | tach | total |
# +--------------------------------+----------+
# | single | 3.442000 |
# +--------------------------------+----------+
# | double double toil and trouble | 3.767000 |
# +--------------------------------+----------+
# | double | 4.436000 |
# +--------------------------------+----------+
@bronson
Copy link

bronson commented Feb 17, 2012

jruby??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment