Jump to content

Does ConsoleWrite() slow down compiled scripts?


Recommended Posts

After fifteen years of working in AutoIt, I'm still a beginner, so I have ConsoleWrite() lines all over my scripts to help me find my mistakes. Is it likely that these lines are slowing down my compiled scripts? If so, would it make sense to replace all the ConsoleWrite() lines with

If Not @Compiled Then ConsoleWrite("data")

Or is it better simply to comment out those lines when I have things working correctly?

I'm not sure there's a clear answer to this question, but I hope someone knows a lot more about it than I do.

Link to comment
Share on other sites

If you want to check speed there is timerInit and timerDiff that can provide you answers to your questions.  Testing by yourself is the better advise I can personally give you, instead of asking those general questions where nobody can answer without knowing the particular situation.  Of course adding consoleWrite to a compiled GUI script is totally useless.  But checking @compiled versus checking a bool variable like $Debug, is it slower or not, it is up to you to test it in your script and decide what is best for you... 

Link to comment
Share on other sites

If you want to keep the ConsoleWrite lines, but want to maintain speed, you could try building a larger string to print later. I haven't tried this before, but I imagine that it would be faster than repeatedly writing. It's something else to test I guess :)

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager
InputBoxes - Simple Input boxes for various variable types

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

×
×
  • Create New...