Skip to content

Instantly share code, notes, and snippets.

@bastos
Created March 23, 2009 14:33
Show Gist options
  • Save bastos/83566 to your computer and use it in GitHub Desktop.
Save bastos/83566 to your computer and use it in GitHub Desktop.
Little benchmark between Curl and Net::Http
#!/usr/bin/env ruby
require 'benchmark'
require 'rubygems'
require 'curl'
require 'net/http'
URL = "URL HERE"
Benchmark.bm do|b|
b.report("CURL") do
1000.times do
Curl::Easy.new("#{URL}").perform
end
end
b.report("STANDARD") do
1000.times do
Net::HTTP.get_response(URI.parse("#{URL}"))
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment