Page 1 of 1

My program is grinding to a hault

PostPosted: June 22nd, 2007, 12:02 am
by Wardlow
Hi,

I know that this is a very vague question to ask, however I was wondering often this is the result of a common thing.

I am running through a BIG loop from 2 to 50. Inside the loop there are smaller loops and it. THis is what is happening. The first loop takes .1 seconds, 2nd loop takes .2 seconds and it keep on getting slower and slower until at loop 25 it's taking about 5 seconds to complete it. Now all the loops should take the same time.

Would anyone have any general comments to make on this or would you have to see the code in order to determine what is going on?

Thanks

PostPosted: June 22nd, 2007, 12:27 am
by Wardlow
ya know I just figured it out. I remember reading that you should pass your arrays my reference because the computer has to make a copy of the whole array to pass in a function.

I usually do this, but I forgot the var part, and as the array got larger and larger so did the amount of copying that I had to do.

PostPosted: June 22nd, 2007, 5:04 am
by Kambiz
It's very good that you could resolve the problem. =D>