From: Elliot Temple Date: 2006-07-05T04:16:03+09:00 Subject: Re: open-uri speed On Jul 3, 2006, at 11:50 PM, Logan Capaldo wrote: > Well of course the second one takes longer. It parses the URI and > then does the same thing as the first. There's at least one more > method call involved with the second every time through the the loop. Method call overhead doesn't account for 2 minutes when N was only set to 1000. At 100,000 times, URI parsing only takes a few seconds. # parse curi.us ran in: 4.434573 seconds. # parse http://www.pythonchallenge.com/pc/def/linkedlist.php ran in: 8.940227 seconds. timing('parse curi.us'){100_000.times do URI.parse("curi.us") end} timing('parse http://www.pythonchallenge.com/pc/def/linkedlist.php') {100_000.times do URI.parse("http://www.pythonchallenge.com/pc/def/linkedlist.php") end} -- Elliot Temple http://www.curi.us/blog/