Jump to content

Performance Penalty In Loops?


Recommended Posts

I have a piece of code that performs

filereadline, StringSplit, and filewriteline until EOF in a while loop. The first 1000 or so iterations occur at or better than 1 line per second (i'm using traytip to display the value every time a particular case is met, which in my data, is usually

every 5 or so lines). Performance (all things being otherwise equal on the same machine) appears to degrade the higher the

line number being read - when I'm reading line 5000 it is taking on the order of 10 seconds per line.

Before I went hog wild debugging and generating all kinds of timer information,

just wanted to know if some true developer type knew of a theoretical reason

why this should occur using AutoIT 3.0? (Ain't it great to be able to say that!!!) :whistle:

If needed, I will happily pull all pertinent info together and post over in the bugs forum -

My memory consumption is not going through the roof, and I am not building any multidimensional arrays in memory as I go, all loop variables are flushed or overwritten each pass.

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Link to comment
Share on other sites

Out of curiosity, are you implementing any sleep() commands in your script?

If not, you may want to throw in a Sleep(10) at the end of some of your main loops. This will allow the computer time to execute other processes, that may be causing a backlog on your system.

Link to comment
Share on other sites

Thank you both for your comments.

I have tried as Larry suggested using fileread() instead of filereadline() , w/ similar performance issues as the loop progresses. I have posted the offending (though otherwise functioning as designed) code in the v3 support forum.

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...