emendelson Posted February 10, 2020 Share Posted February 10, 2020 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 More sharing options...
Nine Posted February 11, 2020 Share Posted February 11, 2020 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... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
emendelson Posted February 11, 2020 Author Share Posted February 11, 2020 Thank you! I didn't know about timerInit and timerDiff (though I should have known about it). I will test this now. Thank you again. Spoiler Link to comment Share on other sites More sharing options...
junkew Posted February 11, 2020 Share Posted February 11, 2020 In tight loops it will allways slow down when writing to console or file. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
emendelson Posted February 11, 2020 Author Share Posted February 11, 2020 @junkew That's very useful to know - thank you. I have a some ConsoleWrite() lines in loops that work through a list of files, and I'll remove those and more. I still haven't done an actual timing test, but hope to do so this week. Link to comment Share on other sites More sharing options...
seadoggie01 Posted February 12, 2020 Share Posted February 12, 2020 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 functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now