On 11/03/10 17:10, Chen Guo wrote: > Hi Padraig, > Thanks for the _unlikely insight, that explains why it's not slower > but the speed up is still quite mysterious. When I ran with the line > lengths you wanted, with check it is no longer faster, but something > else I don't quite understand pops up. > > The file I usually test on is 1M lines, 98 bytes each not counting > newline. Average of5 runs:
Thanks for your tenacity on performance testing, it's most welcome. > bytes with(s) without(s) > ----------------------- > 31 4.02 4.04 > 32 4.37 4.36 > 64 4.44 4.44 > 66 4.81 4.79 > 95 4.97 4.96 > 97 5.15 5.18 I think you may be running into some measurement bias here: http://www-plan.cs.colorado.edu/diwan/asplos09.pdf I would guess that the different size strings are causing alignment differences and thus change the results which ultimately depend on many variables. Varying the sizes disproves that the check is causing it to run faster and it's probably just insignificant (because of __unlikely) in the presence of the other variables. cheers, Pádraig.