From: Ross Bamford Date: 2006-02-16T03:59:13+09:00 Subject: Re: [QUIZ] FasterGenerator (#66) On Thu, 2006-02-16 at 01:46 +0900, Dave Lee wrote: > On 2/14/06, Ross Bamford wrote: > > It seems to be jumping early out of the endless test judging by the > > number of missing assertions. It only happens sometimes (1561 is a full > > pass) and it does happen with the old version too (only just noticed > > it). > > I hope I've fixed the thread bugs I had. At least, I can no longer > duplicate this problem. > > In the tests file you sent me, I made the following change: > > - ... [manual thread timeout code] ... > + fail "Endless iterators unsupported" unless t.join(30) Ahh, cool. I knew there must be a better way to do that. Thanks :) Anyway, here is a new benchmark run. Check out your numbers: ### Construction ### Rehearsal ------------------------------------------------------------- New Thread Generator 0.260000 0.040000 0.300000 ( 0.359351) Old callcc Generator 0.310000 0.100000 0.410000 ( 0.409978) RossBamfordGenerator 1.060000 0.060000 1.120000 ( 1.143501) JesseYoonGenerator 2.530000 0.090000 2.620000 ( 2.644731) JacobFugalGenerator 0.020000 0.000000 0.020000 ( 0.017337) JEGIIGenerator 0.000000 0.000000 0.000000 ( 0.003492) HorndudeGenerator 1.210000 0.010000 1.220000 ( 1.176024) DaveLeeGenerator 0.010000 0.000000 0.010000 ( 0.006422) ChristofferLernoGenerator 0.010000 0.000000 0.010000 ( 0.005104) CalebClausenSyncGenerator 2.780000 0.080000 2.860000 ( 2.872062) CalebClausenGenerator 7.400000 0.110000 7.510000 ( 7.537113) --------------------------------------------------- total: 14.860000sec user system total real New Thread Generator 4.740000 0.090000 4.830000 ( 4.859650) Old callcc Generator 0.060000 0.090000 0.150000 ( 0.157226) RossBamfordGenerator 6.010000 0.050000 6.060000 ( 6.344554) JesseYoonGenerator 7.520000 0.110000 7.630000 ( 7.642123) JacobFugalGenerator 0.010000 0.000000 0.010000 ( 0.020769) JEGIIGenerator 0.000000 0.000000 0.000000 ( 0.004785) HorndudeGenerator 2.070000 0.010000 2.080000 ( 2.113591) DaveLeeGenerator 0.010000 0.000000 0.010000 ( 0.010756) ChristofferLernoGenerator 0.000000 0.000000 0.000000 ( 0.004356) CalebClausenSyncGenerator 9.250000 0.120000 9.370000 ( 9.404799) CalebClausenGenerator 14.170000 0.170000 14.340000 ( 14.400167) ### next() ### Rehearsal ------------------------------------------------------------- New Thread Generator 0.540000 0.000000 0.540000 ( 0.613446) Old callcc Generator 1.530000 0.300000 1.830000 ( 1.920241) RossBamfordGenerator 0.510000 0.000000 0.510000 ( 0.588254) JesseYoonGenerator 1.390000 0.010000 1.400000 ( 1.475440) JacobFugalGenerator 0.470000 0.000000 0.470000 ( 0.546782) JEGIIGenerator 0.040000 0.000000 0.040000 ( 0.086357) HorndudeGenerator 0.000000 0.000000 0.000000 ( 0.006002) DaveLeeGenerator 0.030000 0.000000 0.030000 ( 0.116365) ChristofferLernoGenerator 0.060000 0.000000 0.060000 ( 0.101321) CalebClausenSyncGenerator 0.660000 0.000000 0.660000 ( 0.741025) CalebClausenGenerator 0.450000 0.010000 0.460000 ( 0.544104) ---------------------------------------------------- total: 6.000000sec user system total real New Thread Generator 0.550000 0.000000 0.550000 ( 0.566899) Old callcc Generator 1.510000 0.200000 1.710000 ( 1.725167) RossBamfordGenerator 0.510000 0.000000 0.510000 ( 0.514021) JesseYoonGenerator 1.360000 0.000000 1.360000 ( 1.378787) JacobFugalGenerator 0.460000 0.010000 0.470000 ( 0.467460) JEGIIGenerator 0.040000 0.000000 0.040000 ( 0.041809) HorndudeGenerator 0.000000 0.000000 0.000000 ( 0.007873) DaveLeeGenerator 0.030000 0.000000 0.030000 ( 0.037849) ChristofferLernoGenerator 0.060000 0.000000 0.060000 ( 0.056630) CalebClausenSyncGenerator 0.660000 0.000000 0.660000 ( 0.670666) CalebClausenGenerator 0.420000 0.010000 0.430000 ( 0.432745) According to this and the tests, the entries now stack up like this. I've used the benchmark next() speed above to order the entries fastest to slowest on raw iteration: == Supporting all functionality * Dave Lee * Jacob Fugal * Ross Bamford == Supporting either endless or realtime/stateful iterators, or both * Caleb Clausen (Generator) (Endless, no realtime) * Caleb Clausen (SyncGenerator) (Realtime, no endless) * Jesse Yoon (Endless, no realtime) == Supporting neither endless nor realtime/stateful iterators * Horndude * James Edward Gray II * Christoffer Lerno Assuming there isn't some gap in the tests (sorry, ever the cynic) your fixed version has some very impressive performance, nice job. Now I'm off to see if I can properly figure out how you made it work :) -- Ross Bamford - rosco@roscopeco.REMOVE.co.uk