KaFu Posted April 6, 2022 Posted April 6, 2022 Hiho Community, I'm currently working on the next release of my program AMT. Sadly between v12 and the current Beta the startup time increased from ~2500 to ~11500ms. I've tracked it down to the 282 GUICtrlSetResizing() calls I'm performing in creating the GUI. Commenting those out the startup time is unchanged. Sooooo... I must have implemented something stupid that triggers the GUICtrlSetResizing() to be dramatically slowed down. It's not even consistent across the startup sequence, some calls to GUICtrlSetResizing() take 0.009 (normal) and some 30-60ms (slooow). It's also not related to certain control classes, slow and fast can happen with any class. What background calls happen in GUICtrlSetResizing(), are certain window messages called? What is GUICtrlSetResizing() actually doing? A clueless KaFu looking for tips :), thanks. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
Nine Posted April 6, 2022 Posted April 6, 2022 Did you try to set opt GUIEventOptions to 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) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
KaFu Posted April 6, 2022 Author Posted April 6, 2022 Yes, tried that in v12 (fast) and and v12.0.1.5 (slow), no change. I also see that the later in the script the GUICtrlSetResizing() is called, the slower it is, so the amount of already created controls seems to have an impact too, as if GUICtrlSetResizing() suddenly triggers an re-evaluation of all controls positions? OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
KaFu Posted April 6, 2022 Author Posted April 6, 2022 It's related to the AU version, does not happen in v12 because that one's based on 3.3.14.5, and my current beta runs on 3.3.15.5. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
KaFu Posted April 6, 2022 Author Posted April 6, 2022 Each GUICtrlSetResizing() call now posts 13 windows messages, which it did not before. Note the GUISetState(@SW_HIDE, $hGUI) directly after the GUICreate(). Without that, the messages are not posted. Worked in 3.3.14.5, so something has changed that throws a wrench into the spinning wheel. I did that because otherwise a GUI can not be moved before it is first shown. Knowing that, I guess I can work around that for now. expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Version=Beta #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) Local $hGUI = GUICreate("Example", Default, Default, Default, Default, $WS_OVERLAPPEDWINDOW, $WS_EX_ACCEPTFILES) GUISetState(@SW_HIDE, $hGUI) Local $i_Count = 1000 Local $controls[$i_Count] Local $iTimer = TimerInit() For $i = 0 To ($i_Count / 4) - 1 $controls[$i] = GUICtrlCreateLabel("OK", $i * 2, $i * 2, 85, 25) Next ConsoleWrite(TimerDiff($iTimer) & @CRLF) Local $iTimer = TimerInit() For $i = ($i_Count / 4) To ($i_Count / 2) - 1 $controls[$i] = GUICtrlCreateButton("OK", $i * 2, $i * 2, 85, 25) Next ConsoleWrite(TimerDiff($iTimer) & @CRLF) Local $iTimer = TimerInit() For $i = ($i_Count / 2) To ($i_Count / 4) * 3 - 1 $controls[$i] = GUICtrlCreateEdit("OK", $i * 2, $i * 2, 85, 25) Next ConsoleWrite(TimerDiff($iTimer) & @CRLF) Local $iTimer = TimerInit() For $i = ($i_Count / 4) * 3 To $i_Count - 1 $controls[$i] = GUICtrlCreateCheckbox("OK", $i * 2, $i * 2, 85, 25) Next ConsoleWrite(TimerDiff($iTimer) & @CRLF) For $i = 0 To 32768 GUIRegisterMsg($i, "WM_MESSAGE") Next ConsoleWrite("Start" & @CRLF) Local $iTimer = TimerInit() For $i = 0 To $i_Count - 1 GUICtrlSetResizing($controls[$i], $GUI_DOCKVCENTER + $GUI_DOCKHCENTER + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) ConsoleWrite(@crlf) Next ConsoleWrite(TimerDiff($iTimer) & @CRLF) Exit GUISetState(@SW_SHOW, $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func WM_MESSAGE($hWnd, $iMsg, $wParam, $lParam) ConsoleWrite("0x" & Hex($iMsg,4) & @TAB & "WM_MESSAGE" & @CRLF) Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
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