Modify

Opened 3 years ago

Closed 2 years ago

Last modified 2 years ago

#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 Changed 3 years ago by Jpm

  • Owner set to Jpm
  • Status changed from new to assigned

Thanks
Fix sent to Jon

comment:2 Changed 3 years ago by mLipok

  • Description modified (diff)

comment:3 Changed 3 years ago by KaFu

Top, thanks!

comment:4 Changed 3 years ago by Jon

  • Milestone set to 3.3.15.6
  • Owner changed from Jpm to Jon
  • Resolution set to Fixed
  • Status changed from assigned to closed

Fixed by revision [12714] in version: 3.3.15.6

comment:5 Changed 3 years ago by Jon

  • Milestone changed from 3.3.15.6 to 3.3.16.1

Fixed by revision [12717] in version: 3.3.16.1

comment:6 Changed 2 years ago by Jpm

  • Resolution Fixed deleted
  • Status changed from closed to reopened

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

comment:7 Changed 2 years ago by TicketCleanup

  • Milestone 3.3.16.1 deleted

Automatic ticket cleanup.

comment:8 Changed 2 years ago by Jpm

  • Milestone set to 3.3.15.6
  • Owner changed from Jon to Jpm
  • Resolution set to Fixed
  • Status changed from reopened to closed

Fixed by revision [12745] in version: 3.3.15.6

comment:9 Changed 2 years ago by Jpm

  • Milestone changed from 3.3.15.6 to 3.3.16.1

Fixed by revision [12746] in version: 3.3.16.1

comment:10 Changed 2 years ago by Jpm

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

comment:11 Changed 2 years ago by Jon

  • Owner changed from Jpm to Jon

Fixed by revision [12757] in version: 3.3.16.1

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain Jon.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.