From: Elliot Temple Date: 2006-07-04T13:51:29+09:00 Subject: open-uri speed I just discovered this. Lots of people already know, I'm sure, but maybe some don't. # net/http ran in: 128.734298 seconds. # open-uri ran in: 268.869359 seconds. require "net/http" require "open-uri" def timing(name) start_time = Time.now yield end_time = Time.now puts "#{name} ran in: #{end_time - start_time} seconds." end n = 1_000 timing("net/http") {Net::HTTP.start("www.pythonchallenge.com") do |http| n.times do |i| r = http.get("/pc/def/linkedlist.php") end end} timing("open-uri") {n.times do |i| open("http://www.pythonchallenge.com/pc/def/linkedlist.php") do |x| x.read end end} -- Elliot Temple http://www.curi.us/blog/