Information générale
Catégorie:
Codage, syntaxe et commandes
George,
I agree. Some of the debates about the 'fastest way' have little meaning in production applications. They are an academic exercise unless, as you say, they're inside a loop running into the millions of iterations. (Or, possibly, on dog-slow machines.)
Guy
>>Hi George,
>>
>>For a million loops, something like 1.4 seconds versus 1.2 seconds, consistently and with nothing else running.
>>
>>I think I mentioned this earlier ... I have known IF...ENDIF to be faster for quite some time now. I thought it was common wisdom and I was surprised when I saw messages stating IIF was faster. So I just took a couple of minutes and whipped up this example.
>>
>>You can try the code yourself for further validation.
>>
>>Bottom line ... I have no inside knowledge here, but I have always believed that for all versions ... as long as IIF has been around, IF...ENDIF has been faster.
>>
>Guy
>
>I didn't do a real thorough test (I had other apps open and only ran about 4 iterations of the test). However, on a PIII 933, I got inconsistent results. In some cases IIF() was faster and in others it wasn't. Which is truly faster, however, took a back seat to the differences between the two over a million iterations. The largest amount was less than 1/10th of a second. So I would have to conclude that unless the routine was being called in excess of a million times, which is actually faster is pretty much of a moot point.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement