Skip to content

Instantly share code, notes, and snippets.

@jiangmiao
Created March 26, 2010 01:24
Show Gist options
  • Save jiangmiao/344366 to your computer and use it in GitHub Desktop.
Save jiangmiao/344366 to your computer and use it in GitHub Desktop.
# Ruby 1.8.7
$ cat foo.rb;gem environment;(for i in {1..10} ; do ruby foo.rb ; done)|awk '{print $1;s+=$1} END {print "avg:", s/NR}'
st=Time.now.to_f
#$:.replace($:[-9,9])
require 'rubygems'
Gem::LoadError
puts Time.now.to_f-st
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.6
- RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [i686-linux]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /usr/local/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /usr/local/lib/ruby/gems/1.8
- /home/miao/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
0.119347095489502
0.0920889377593994
0.12005615234375
0.1037437915802
0.105262041091919
0.0990140438079834
0.0931508541107178
0.0928289890289307
0.147569894790649
0.0946152210235596
avg: 0.106768
#------------------------------------------------------------------------------
# Ruby 1.9.2dev full gem path included
$ cat foo.rb;gem environment;(for i in {1..10} ; do ruby foo.rb ; done)|awk '{print $1;s+=$1} END {print "avg:", s/NR}'
st=Time.now.to_f
#$:.replace($:[-9,9])
require 'rubygems'
Gem::LoadError
puts Time.now.to_f-st
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.6
- RUBY VERSION: 1.9.2 (2010-03-26 patchlevel -1) [i686-linux]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: /usr/local/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /usr/local/lib/ruby/gems/1.9.1
- /home/miao/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
0.19039320945739746
0.18254566192626953
0.1700739860534668
0.17015767097473145
0.1679682731628418
0.1774747371673584
0.23279404640197754
0.1617262363433838
0.20814251899719238
0.18431735038757324
avg: 0.184559
#------------------------------------------------------------------------------
#Ruby 1.9.1 cut $: to contain 9 directories
$ cat foo.rb;gem environment;(for i in {1..10} ; do ruby foo.rb ; done)|awk '{print $1;s+=$1} END {print "avg:", s/NR}'
st=Time.now.to_f
$:.replace($:[-9,9])
require 'rubygems'
Gem::LoadError
puts Time.now.to_f-st
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.6
- RUBY VERSION: 1.9.2 (2010-03-26 patchlevel -1) [i686-linux]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: /usr/local/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /usr/local/lib/ruby/gems/1.9.1
- /home/miao/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
0.17685341835021973
0.14941930770874023
0.1711270809173584
0.16497159004211426
0.13980793952941895
0.1524956226348877
0.1440420150756836
0.1636965274810791
0.14403343200683594
0.18135333061218262
avg: 0.15878
#------------------------------------------------------------------------------
1.8.7 0.106 100%
1.9.2 0.184 174%
1.9.2cut 0.158 149%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment