Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Coding Standards
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00115272
Message ID:
00115476
Vues:
17
>>But, let me answer question. I don't deal with the same type of data or same situations that you do. However, in those cases where a large numer of iterations are required, I've had success in re-examining the problem to see if there is a smaller subset that can be used.
>
>2**20 _IS_ a smaller subset, it was 2**40 before invoking some theory :) But your point is on target, this current work is an math optimization problem. 2**20 is small potatoes in this league, in order to get publishable results I'm likely going up to 2**1000 or so, no small run-time (I think we're talking years here)...it will not be solvable without some major theoretical optimization, I think...
>
>>I certainly don't mean to pick, my friend, but your example brings a question to mind. If speed is so essential there, why do you force the system to re-evaluate the terminating expression (2**20 or 2^20) every time through the loop. You gain more speed by:
>>lnlast = 2 ^ 20
>>FOR ncount = 1 TO lnlast
>>  * The same stuff here
>>ENDFOR
>
>Hey, nice tip...hadn't even occurred to me. That could add up to big savings...

it is one of the first rules I learnt - always take functions out of loops (if at all possible)

Arnon
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform