Created
December 30, 2010 04:22
-
-
Save hone/759451 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unless File.exists?("rake-0.8.7.gem") | |
puts 'downloading rake gem...' | |
require 'open-uri' | |
File.open('rake-0.8.7.gem','w'){|f| f.write open("http://production.cf.rubygems.org/gems/rake-0.8.7.gem").read } | |
end | |
require 'zlib' | |
require 'rubygems/format' | |
class Zlib::GzipReader | |
class << self | |
alias new_orig new | |
def new(*args) | |
GC.stress=true | |
new_orig(*args) | |
ensure | |
GC.stress=false | |
end | |
end | |
end | |
def parse_gem | |
Gem::Format.from_file_by_path('rake-0.8.7.gem') | |
end | |
1000.times do |i| | |
p [Time.now, i+1] | |
parse_gem | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment