Modify

#3875 closed Bug (Fixed)

GUICtrlSetResizing() performance

Reported by: KaFu Owned by: Jon
Milestone: 3.3.16.1 Component: AutoIt
Version: 3.3.15.5 Severity: None
Keywords: Cc:

Description (last modified by mLipok)

Hiho Team,

maybe you saw my posting in the open help forum about GUICtrlSetResizing() performance.

I've tracked it further down, and it seems that as of 3.3.15.5 the Windows Message pump for a certain Window is engaged on the first call of GUISetState() for that Window.

This degrades the performance of GUICtrlSetResizing() after that call drastically, and the time increase per call is also proportional to the amount of controls.

100 calls in 3.3.14.5 take 0.2ms, in 3.3.15.5 690ms on my computer.

Best Regards

#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)
GUISetState(@SW_LOCK, $hGUI)


For $i = 0 To 32768
        GUIRegisterMsg($i, "WM_MESSAGE")
Next
ConsoleWrite("Start" & @CRLF)

Local $i_Count = 100
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)
        GUICtrlSetColor(-1, 0x0000ff)
        GUICtrlSetBkColor(-1, 0x0000ff)
        GUICtrlSetCursor(-1, 1)
        GUICtrlSetTip(-1, "tip of my label")
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)


Local $iTimer = TimerInit()
For $i = 0 To $i_Count - 1
        Local $iTimer2 = TimerInit()
        ; GUICtrlSetResizing($controls[$i], $GUI_DOCKVCENTER + $GUI_DOCKHCENTER + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
        GUICtrlSetResizing($controls[$i], $GUI_DOCKBOTTOM + $GUI_DOCKHCENTER + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
        ConsoleWrite($i & @TAB & Round(TimerDiff($iTimer)) & @TAB & Round(TimerDiff($iTimer2)) & @CRLF)
Next
ConsoleWrite(TimerDiff($iTimer) & @CRLF)

Exit



Func WM_MESSAGE($hWnd, $iMsg, $wParam, $lParam)
        If $iMsg = 0x0005 Then ConsoleWrite("0x" & Hex($iMsg, 4) & @TAB & "WM_MESSAGE" & @CRLF)
        Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_MESSAGE

Attachments (0)

Change History (11)

comment:1 by J-Paul Mesnage, on Apr 8, 2022 at 12:20:24 PM

Owner: set to J-Paul Mesnage
Status: newassigned

Thanks
Fix sent to Jon

comment:2 by mLipok, on Apr 8, 2022 at 5:57:34 PM

Description: modified (diff)

comment:3 by KaFu, on Apr 9, 2022 at 9:26:12 AM

Top, thanks!

comment:4 by Jon, on May 2, 2022 at 2:39:14 PM

Milestone: 3.3.15.6
Owner: changed from J-Paul Mesnage to Jon
Resolution: Fixed
Status: assignedclosed

Fixed by revision [12714] in version: 3.3.15.6

comment:5 by Jon, on May 16, 2022 at 2:30:38 PM

Milestone: 3.3.15.63.3.16.1

Fixed by revision [12717] in version: 3.3.16.1

comment:6 by J-Paul Mesnage, on Jun 3, 2022 at 7:52:14 PM

Resolution: Fixed
Status: closedreopened

THe solution is not complete so I will work again on it

comment:7 by TicketCleanup, on Jun 3, 2022 at 8:00:02 PM

Milestone: 3.3.16.1

Automatic ticket cleanup.

comment:8 by J-Paul Mesnage, on Jun 3, 2022 at 11:49:02 PM

Milestone: 3.3.15.6
Owner: changed from Jon to J-Paul Mesnage
Resolution: Fixed
Status: reopenedclosed

Fixed by revision [12745] in version: 3.3.15.6

comment:9 by J-Paul Mesnage, on Jun 3, 2022 at 11:54:20 PM

Milestone: 3.3.15.63.3.16.1

Fixed by revision [12746] in version: 3.3.16.1

comment:10 by J-Paul Mesnage, on Jun 3, 2022 at 11:56:58 PM

the regression was due to #3831 which was patch by error

comment:11 by Jon, on Jun 5, 2022 at 3:00:06 PM

Owner: changed from J-Paul Mesnage to Jon

Fixed by revision [12757] in version: 3.3.16.1

Modify Ticket

Action
as closed The owner will remain Jon.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.