bastos (owner)

Revisions

gist: 83566 Download_button fork
public
Description:
Little benchmark between Curl and Net::Http
Public Clone URL: git://gist.github.com/83566.git
Embed All Files: show embed
Text only #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/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