Skip to content

Instantly share code, notes, and snippets.

@ryana
Created October 7, 2011 16:36
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 ryana/1270739 to your computer and use it in GitHub Desktop.
Save ryana/1270739 to your computer and use it in GitHub Desktop.
hydra is hawt
ruby-1.9.2-p180 :033 > Benchmark.measure { urls.each {|u| req = Typhoeus::Request.new(u); req.on_complete {|resp| puts [resp.code, resp.body.size].map(&:to_s).join(', ') }; hydra.queue(req) }; hydra.run }
301, 242
302, 352
301, 337
302, 0
301, 0
200, 3291
301, 350
301, 178
301, 417
200, 9317
301, 317
200, 81200
200, 51454
200, 46953
200, 58607
200, 95803
200, 45501
200, 130514
200, 102374
200, 117456
=> 0.060000 0.100000 0.160000 ( 2.246279)
ruby-1.9.2-p180 :034 > Benchmark.measure { urls.each {|u| resp = Typhoeus::Request.get(u); puts [resp.code, resp.body.size].map(&:to_s).join(', ') } }
200, 102374
200, 51453
200, 58607
200, 81200
301, 0
200, 45501
200, 3291
301, 337
301, 417
301, 350
301, 242
200, 130514
301, 317
301, 178
200, 117532
200, 46953
200, 9317
200, 95937
302, 0
302, 352
=> 0.350000 0.370000 0.720000 ( 16.719559)
ruby-1.9.2-p180 :035 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment