Re: Contest Update (12-Nov-2004)
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Nov 13, 2004
- 490 views
On Fri, 12 Nov 2004 21:39:22 +0000, Chris Bensler <bensler at nt.net> wrote: >The first bit of code checks the 'state' of the variable. It checks > an internal flag, not the value of the variable. Sorry, I think you *completely* misunderstood the question. (my fault, probably) The maths just on the "if" part is: first: 5.08% * 3.8 = 0.19304 seconds second: 1.08% * 6.8=0.07344 seconds. (at least that is what with profile_time repeatedly tells me) What that tells me (I need to test this I guess) is that "atom()" is in fact slower that "=0" (anyway). Nevertheless, if I "lost" on that test, I would accept it, but bear the above numbers in mind. > >The second bit of code checks the value of the variable and does a >comparison. > But both line 1 + line 2 together (as the only changes) account, at most, for 0.3648 seconds, and, in the case I think would be faster, but ain't, 0.09656 seconds. (again, that is what with profile_time repeatedly tells me) All other lines being equal, where has the extra *3* whole seconds of runtime (78%) come from? Would you be happy that changing one line from "atom()" to "=0" nearly doubles the runtime? If it did, would you like to know why? I do! I know you can't second-guess my code, I probably need to work on making a simpler case exhibit the same effect, which just may never have been noticed by anyone else, ever, before, but I kinda doubted, and hoped against that. Regards, Pete