Opened 13 years ago

Closed 13 years ago

#2037 closed Bug (Fixed)

COM speed deterioration

Reported by: trancexx Owned by: trancexx
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:


User Ascend4nt reported this.

So the beta COM interface has slowed down tremendously. I know there's been major changes, but this is a huge performance difference. I'm seeing between 4-5x slower speed on the code below on beta and, versus the production
(Use it with at least one folder with a few hundred or so items, thats where the performance difference is most noticeable):

; ==========================================================================================================================
; Func _ObjectSHFolderViewFromWin($hWnd)
; Returns an 'ShellFolderView' Object for the given Window handle
; Author: Ascend4nt, based on code by KaFu, klaus.s
; ==========================================================================================================================
Func _ObjectSHFolderViewFromWin($hWnd)
    If Not IsHWnd($hWnd) Then Return SetError(1,0,0)
    Local $oShell,$oShellWindows,$oIEObject,$oSHFolderView
    ; Shell Object
    If Not IsObj($oShell) Then Return SetError(2,0,0)
;   Get a 'ShellWindows Collection' object
    $oShellWindows = $oShell.Windows()
    If Not IsObj($oShellWindows) Then Return SetError(3,0,0)
;   Iterate through the collection - each of type 'InternetExplorer' Object
    For $oIEObject In $oShellWindows
        If $oIEObject.HWND = $hWnd Then
            ; InternetExplorer->Document = ShellFolderView object
            If IsObj($oSHFolderView) Then Return $oSHFolderView
            Return SetError(4,0,0)
    Return SetError(-1,0,0)
; ==========================================================================================================================
; Func _ExplorerWinGetAllItems($hWnd)
; Author: Ascend4nt, based on code by klaus.s, KaFu
; ==========================================================================================================================
Func _ExplorerWinGetAllItems($hWnd)
    If Not IsHWnd($hWnd) Then Return SetError(1,0,'')
    Local $oSHFolderView,$oFolderItem,$oFolderItems
    Local $iTotal,$iCounter=2,$aItems[2] = [0, ""]
    If @error Then Return SetError(@error,0,'')
;   Folder->FolderItems Collection
    $oFolderItems = $oSHFolderView.Folder.Items
    $iTotal = $oFolderItems.Count
    Dim $aItems[$iTotal+2]  ; 2 extra -> 1 for count [0], 1 for Folder path [1]
;   ShellFolderView->Folder->Self as 'FolderItem'->Path
    For $oFolderItem In $oFolderItems
        $aItems[$iCounter] = $oFolderItem.Path
        $iCounter += 1
    Return SetExtended($iCounter-2,$aItems)
EndFunc   ;==>_ExplorerWinGetAllItems
; ==========================================================================================================================
; ==========================================================================================================================
#include <Array.au3>
ConsoleWrite("AutoIt Version:"&@AutoItVersion&@CRLF)
For $i = 1 To $aWinList[0][0]
    $aSelection = _ExplorerWinGetAllItems($aWinList[$i][1])
    ConsoleWrite("Time:"&TimerDiff($iTimer)&" ms"&@CRLF)
    _ArrayDisplay($aSelection, "Explorer Instance #" & $i & " / " & $aWinList[$i][0])

Attachments (0)

Change History (1)

comment:1 Changed 13 years ago by trancexx

  • Milestone set to
  • Owner set to trancexx
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [6367] in version:

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

as closed The owner will remain trancexx.

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

Note: See TracTickets for help on using tickets.