Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Which Should I Use IF/ENDIF or IIF
Message
De
15/06/2002 10:10:02
Guy Pardoe
Pardoe Development Corporation
Peterborough, New Hampshire, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00668532
Message ID:
00668884
Vues:
27
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
Fil
Voir

Click here to load this message in the networking platform