Skip to content

Instantly share code, notes, and snippets.

@pauldix
Created March 5, 2009 17:05
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 pauldix/74435 to your computer and use it in GitHub Desktop.
Save pauldix/74435 to your computer and use it in GitHub Desktop.
calls = 10
@klass = Class.new do
include HTTPMachine
end
benchmark do |t|
t.report("httpmachine") do
HTTPMachine.service_access do
calls.times do
s = nil
@klass.get("http://127.0.0.1:3000") do |response_code, response_body|
s = response_body
end
end
end
end
t.report("net::http") do
calls.times do
s = open("http://127.0.0.1:3000").read
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment