0

How do I best speed up running of my prog?
Once I have simplified code as much as possible, made it smaller. By using loops were appropriate etc.

All ideas are welcome :D

3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by Reverend Jim
0

Well, I do not know of a specific code but I do have some tips for you to help the overall functionality of your application. Most of which are listed here so check this out and I hope this helps!

-Chris

0

Well, I do not know of a specific code but I do have some tips for you to help the overall functionality of your application. Most of which are listed here so check this out and I hope this helps!

I found that article to be quite dated and it contains obvious errors such as the example for loop unrolling which states:

For i = 1 To 100 step 2
    b = somefun(b)
    b = somefun(b)
Next i

which clearly should have been more like

For i = 1 To 100 step 2
    b1 = somefun(i)
    b2 = somefun(i+1)
    'some other code here to do something with b1 and b2
Next i

The numerous grammatical and spelling errors make me suspect that the article was hastily written and not proofed.

Also, I can't imagine that there are any major compilers out there that don't automatically optimize an expression like

for i = 1 to len(x)-1

so that len(x) is not recalculated for each iteration of the loop. I agree with one of the comments posted that The difference in execution speed had better be significant to outweigh the loss in readability and clarity.

Having said that, there are still a few good pointers such as moving calculations that are not loop dependent out of the loop.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.