Skip to content

Instantly share code, notes, and snippets.

@hone
Created December 30, 2010 04:22
Show Gist options
  • Save hone/759451 to your computer and use it in GitHub Desktop.
Save hone/759451 to your computer and use it in GitHub Desktop.
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