Skip to content

Instantly share code, notes, and snippets.

@phiggins
Created December 1, 2010 05:12
Show Gist options
  • Save phiggins/722992 to your computer and use it in GitHub Desktop.
Save phiggins/722992 to your computer and use it in GitHub Desktop.
diff --git a/benchmarks/excon_vs.rb b/benchmarks/excon_vs.rb
index 5fa84e7..9f5e0cb 100644
--- a/benchmarks/excon_vs.rb
+++ b/benchmarks/excon_vs.rb
@@ -69,15 +69,6 @@ with_server do
}
end
- tach('Excon') do
- Excon.get(url).body
- end
-
- excon = Excon.new(url)
- tach('Excon (persistent)') do
- excon.request(:method => 'get').body
- end
-
tach('HTTParty') do
HTTParty.get(url).body
end
@@ -110,6 +101,15 @@ with_server do
Typhoeus::Request.get(url).body
end
+ tach('Excon') do
+ Excon.get(url).body
+ end
+
+ excon = Excon.new(url)
+ tach('Excon (persistent)') do
+ excon.request(:method => 'get').body
+ end
+
end
end
@@ -135,4 +135,4 @@ end
# | open-uri | 2.936382 |
# +--------------------------+----------+
# | em-http-request | 3.933757 |
-# +--------------------------+----------+
\ No newline at end of file
+# +--------------------------+----------+
$ ruby benchmarks/excon_vs.rb
[em-http-request, HTTParty, Net::HTTP, Net::HTTP (persistent), open-uri, RestClient, StreamlyFFI (persistent), Typhoeus, Excon/home/phiggins/projects/excon/lib/excon/response.rb:12:in `readline': end of file reached (Excon::Errors::SocketError)
from /home/phiggins/projects/excon/lib/excon/response.rb:12:in `parse'
from /home/phiggins/projects/excon/lib/excon/connection.rb:98:in `request'
from (eval):2:in `get'
from benchmarks/excon_vs.rb:105
from /home/phiggins/.rvm/gems/ruby-1.8.7-p302/gems/tach-0.0.5/lib/tach.rb:58:in `instance_eval'
from /home/phiggins/.rvm/gems/ruby-1.8.7-p302/gems/tach-0.0.5/lib/tach.rb:58:in `run_tach'
from /home/phiggins/.rvm/gems/ruby-1.8.7-p302/gems/tach-0.0.5/lib/tach.rb:57:in `each'
from /home/phiggins/.rvm/gems/ruby-1.8.7-p302/gems/tach-0.0.5/lib/tach.rb:57:in `run_tach'
from /home/phiggins/.rvm/gems/ruby-1.8.7-p302/gems/tach-0.0.5/lib/tach.rb:33:in `initialize'
from /home/phiggins/.rvm/gems/ruby-1.8.7-p302/gems/tach-0.0.5/lib/tach.rb:32:in `each'
from /home/phiggins/.rvm/gems/ruby-1.8.7-p302/gems/tach-0.0.5/lib/tach.rb:32:in `initialize'
from /home/phiggins/.rvm/gems/ruby-1.8.7-p302/gems/tach-0.0.5/lib/tach.rb:7:in `new'
from /home/phiggins/.rvm/gems/ruby-1.8.7-p302/gems/tach-0.0.5/lib/tach.rb:7:in `meter'
from benchmarks/excon_vs.rb:59
from benchmarks/excon_vs.rb:42:in `with_server'
from benchmarks/excon_vs.rb:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment