From: Alex Young Date: 2006-08-06T16:48:21+09:00 Subject: Re: [ANN] RFuzz 0.7 -- Win32, Bug Fix, Browser Begins Alex Young wrote: > Zed Shaw wrote: >> I'd also be curious for the same test run with the RFuzz call being done >> inside a Timeout block. RFuzz doesn't do any of that (bare metal), and >> I know Timeout blocks fire up an extra thread and eat up a bit more CPU. >> I'm betting that putting RFuzz inside Timeout makes it about the same >> speed at net/http. > > Not quite: > But then again, that's not what Net::HTTP's actually doing - it puts a > timeout around every single rbuf_fill call, so by default it has to > spawn a new thread for every 1K of data it intends to receive. I'm sure > there's a damn good reason for that, but it's a reason I don't think I'd > have spotted if I was writing it. Ok, having actually stopped and thought about it for a second, I can see why they've done that. > That shouldn't be a problem on this > test, though - the file it's downloading is only 715 bytes. I'll try > the test with a bigger file and see what I can see. > alex@pandora:~/Desktop/Noodling/ruby$ ruby rfuzz_test.rb Rehearsal ------------------------------------------------------- net/http 7.890000 1.490000 9.380000 ( 9.411633) net/http big 1055.150000 119.690000 1174.840000 (1185.696163) rfuzz 2.840000 0.990000 3.830000 ( 4.065557) rfuzz+timeout 3.380000 1.190000 4.570000 ( 4.569331) rfuzz big 169.730000 47.670000 217.400000 (218.332456) rfuzz+timeout big 205.470000 59.000000 264.470000 (271.745557) ------------------------------------------- total: 1674.490000sec user system total real net/http 7.880000 1.470000 9.350000 ( 9.454987) net/http big 1056.710000 113.930000 1170.640000 (1173.337412) rfuzz 2.850000 0.980000 3.830000 ( 3.831175) rfuzz+timeout 3.420000 1.180000 4.600000 ( 4.609152) rfuzz big 175.550000 45.900000 221.450000 (221.584886) rfuzz+timeout big 205.930000 55.530000 261.460000 (262.673411) The .*big results are from downloading the results of dd if=/dev/zero of=big_file bs=1M count=1... that is, 1MB of zeros. Interesting. -- Alex