Neat Posted April 2, 2020 Share Posted April 2, 2020 Hi everyone. I noticed something very weird on my windows 10 computer. When the script isn't "graphic" (no msgbox, inputbox, gui etc), the script is relatively fast. Whenever a script becomes "graphic" (a msgbox was launched) its execution is then 6 times slower. Here are the results of the execution of this script : $x=0 $start=TimerInit() for $i=1 to 500000 $x+=1 Next MsgBox(0,"",TimerDiff($start)) ;160ms => becoming slower now because of the msgbox $start=TimerInit() $x=0 for $i=1 to 500000 $x+=1 Next MsgBox(0,"",TimerDiff($start)) ;1300ms I tried on my windows 7 computer and the bug isn't there. I tried everything and it really comes to this => whenever something graphic has been prompted, even if it's over, the script is way slower then. Can someone try to reproduce this? And how do I report a bug? Musashi 1 Link to comment Share on other sites More sharing options...
TheXman Posted April 2, 2020 Share Posted April 2, 2020 First, why did you post this in the "AutoIt Projects and Collaboration" forum? This has nothing to do with a project or a collaboration. I do not get any large differences between the 2 loops when I execute your code: $x=0 $start=TimerInit() for $i=1 to 500000 $x+=1 Next ConsoleWrite("Loop 1 Elapsed time: " & TimerDiff($start) & @CRLF) $x=0 $start=TimerInit() for $i=1 to 500000 $x+=1 Next ConsoleWrite("Loop 2 Elapsed time: " & TimerDiff($start) & @CRLF) Output: Loop 1 Elapsed time: 64.3125556633415 Loop 2 Elapsed time: 64.5393475676982 CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
Nine Posted April 2, 2020 Share Posted April 2, 2020 Confirmed. on Win10 the scale is similar as yours 10x slower after the MsgBox. On Win7 no impact. “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...
seadoggie01 Posted April 2, 2020 Share Posted April 2, 2020 Win10 Enterprise shows similar results after the MsgBox. Interestingly, subsequent loops have the same speed as the second loop, never reverting to the original speed. 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...
Nine Posted April 2, 2020 Share Posted April 2, 2020 @TheXman Yes as with you, using ConsoleWrite has no impact “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...
TheXman Posted April 2, 2020 Share Posted April 2, 2020 (edited) LOL, yes I just noticed that. I see the same discrepancies, as the original post, when I execute the script with MsgBox, Edited April 2, 2020 by TheXman seadoggie01 1 CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
Nine Posted April 2, 2020 Share Posted April 2, 2020 Tested with a GuiCreate, after show and even GuiDelete, same phenomenon... “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...
Developers Jos Posted April 2, 2020 Developers Share Posted April 2, 2020 Moved to the appropriate forum. Moderation Team SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Nine Posted April 2, 2020 Share Posted April 2, 2020 Interesting enough, if you replace the MsgBox with this line then the phenomenon disappear : RunWait (@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(4096, ''Hello World!'', ''Hi!'')"') badcoder123 1 “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...
seadoggie01 Posted April 2, 2020 Share Posted April 2, 2020 No that makes sense (I think), everything gets garbage collected after the executed line exits and it's all in another process so it doesn't matter to the current process 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...
Nine Posted April 2, 2020 Share Posted April 2, 2020 Yes, I know but I found it interesting to notice, that the process is not corrupted by the appearance of a GUI, but it is intrinsic to its own process. seadoggie01 1 “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...
jchd Posted April 2, 2020 Share Posted April 2, 2020 Only Devs can tell but isn't the issue related to the various hooks or message interceptions that AutoIt core has to setup before any GUI operation, which aren't needed until the first GUI is invoked. But why is Win 10 different from Win 7 in this aspect is a mystery to me. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Developers Jos Posted April 2, 2020 Developers Share Posted April 2, 2020 14 minutes ago, jchd said: Only Devs can tell but isn't the issue related to the various hooks or message interceptions that AutoIt core has to setup before any GUI operation I doubt this, without having looked at it in detail in the source, but AutoIt3 always has a background GUI running to be able to work with the Windows Messages. A call to MSGBOX is really a standard DLL call to MessageBoxW. .... maybe one could try using that to see if that is similar? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Neat Posted April 2, 2020 Author Share Posted April 2, 2020 Thank you all for your answers, and sorry for posting on the wrong forum, that's my first post. Do I need to do anything for the devs to know about it? Or you guys handle that? Btw my guess was : whenever the script display something (even once) it suddenly gets different from a "classical script" (as you said different hooks etc), maybe windows 7 manages to get back to a classic execution, and windows 10 doesn't. Knowing that, executing the msgbox through another script solves it, thanks for your trick ! I hope it's gonna be solved soon (or a work around) because it means you can never have both a quick script and displaying windows on windows 10.. Link to comment Share on other sites More sharing options...
Nine Posted April 2, 2020 Share Posted April 2, 2020 @Jos is right. Tested all the MessageBox and MessageBoxEx, the same behavior appears. Seems it is more of a Win10 problem (again). Sigh... “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...
jchd Posted April 2, 2020 Share Posted April 2, 2020 Ouch! It's surprising that others applications don't seem to exhibit that slow behavior under W10, at least I can't find any significantly slower app under W10 than W7 and on the contrary, I feel my rig more responsive (I upgraded just recently). This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
jchd Posted April 2, 2020 Share Posted April 2, 2020 (edited) SplashTextOn() doesn't slow things... MsgBox() slows by factor 6 for me! That's something! EDIT: MsgBox() still slows thing by 6 in compiled CUI scripts... Edited April 2, 2020 by jchd This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Nine Posted April 2, 2020 Share Posted April 2, 2020 By killing dwm.exe I cut by more than 3 the slowness effect. It is still 3 times slower after showing the MsgBox but it is an improvement... “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...
Neat Posted April 2, 2020 Author Share Posted April 2, 2020 Here's a function to avoid the issue (also allows a non-blocking msgbox). It's an ugly version but I'm sure you guys will improve it Func MsgBox_ext($type = 0, $title = "", $txt = "", $block = 1) $txt = StringRegExpReplace($txt, "('|" & '")', "$1$1") $type = StringRegExpReplace($type, "('|" & '")', "$1$1") $title = StringRegExpReplace($title, "('|" & '")', "$1$1") If $block <> 1 Then Return Run(@AutoItExe & ' /AutoIt3ExecuteLine "' & "MsgBox('" & $type & "','" & $title & "','" & $txt & "')" & '"') Else Return RunWait(@AutoItExe & ' /AutoIt3ExecuteLine "' & "Exit(MsgBox('" & $type & "','" & $title & "','" & $txt & "'))" & '"') EndIf EndFunc ;==>MsgBox_ext Link to comment Share on other sites More sharing options...
Nine Posted April 3, 2020 Share Posted April 3, 2020 Could someone test the same with C++ on Win10 ? Thanks. “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...
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