Michel Claveau Posted August 7, 2009 Posted August 7, 2009 Hi! Fill listview is (very) slow (I think more than 10000 lines & 10 col) Because there are many (100000) _SendMessage($hWnd, $LVM_SETITEMW, 0, $pItem, 0, "wparam", "ptr") I search a way for fast fill a listview (perhaps if we send a big struct?) Any idea? Thank you in advance
water Posted August 7, 2009 Posted August 7, 2009 Please have a look at this post. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Zedna Posted August 10, 2009 Posted August 10, 2009 Also look at my post about ListView UDF speed optimization http://www.autoitscript.com/forum/index.php?showtopic=67829 Resources UDF ResourcesEx UDF AutoIt Forum Search
Michel Claveau Posted August 12, 2009 Author Posted August 12, 2009 Hi! Sorry for delay. Thank you for answers. I made various tests. The more fast is: Func lv_AddArray($h, $hh, ByRef $aItems, $limite=29999) ;;;memo:$hh=GUICtrlGetHandle($h) Local $i,$nb,$nbvisu $nb=UBound($aItems)-1 $nbvisu=50 ;_SendMessage($hh, $LVM_DELETEALLITEMS) _SendMessage($hh,$WM_SETREDRAW,0,0) For $i=0 To _Min($nbvisu,$nb) GUICtrlCreateListViewItem($aItems[$i], $h) Next _SendMessage($hh,$WM_SETREDRAW,1,0) If $nb>$nbvisu Then _SendMessage($hh,$WM_SETREDRAW,0,0) For $i=$nbvisu+1 to $nb GUICtrlCreateListViewItem($aItems[$i], $h) Next _SendMessage($hh,$WM_SETREDRAW,1,0) EndIf EndFunc This routine calculates 50 lines, shows them, then calculates the rest (better aspect/depiction for users) But it remains slow. And, nevertheless my old (2 years) laptop is 3 times as fast as the machine of Zedna... (tested with his example) It remains slow... Other thing: ReDraw+GUICtrlCreateListViewItem change the size of columns (with data's length). _SendMessage($h, $LVM_SETITEMW... do not change the size, but it is more slow. Perhaps a ReDraw+GUICtrlCreateListViewItem who do not change the size of columns would it be faster? @+
Authenticity Posted August 12, 2009 Posted August 12, 2009 >_< Supper speed. You can use GUICtrlSendMsg() if the control is AutoIt native control, i.e. GUICtrlCreate*.
Michel Claveau Posted August 12, 2009 Author Posted August 12, 2009 Hi! Supper speed. You can use GUICtrlSendMsg() if the control is AutoIt native control, i.e. GUICtrlCreate*. GUICtrlSendMsg() is more slow than _SendMessage() If you do not want my trick "display immediate and calculate next", the fastest means which I found is: Func lv_AddArray($h, $hh, ByRef $aItems, $limite=9999) Local $i _SendMessage($hh,$WM_SETREDRAW,0,0) ;_SendMessage($hh, $LVM_DELETEALLITEMS) For $i in $aItems GUICtrlCreateListViewItem($i, $h) Next _SendMessage($hh,$WM_SETREDRAW,1,0) EndFunc But, it remains still too slow for my needs.
Yashied Posted August 12, 2009 Posted August 12, 2009 Hi! GUICtrlSendMsg() is more slow than _SendMessage() If you do not want my trick "display immediate and calculate next", the fastest means which I found is: Func lv_AddArray($h, $hh, ByRef $aItems, $limite=9999) Local $i _SendMessage($hh,$WM_SETREDRAW,0,0) ;_SendMessage($hh, $LVM_DELETEALLITEMS) For $i in $aItems GUICtrlCreateListViewItem($i, $h) Next _SendMessage($hh,$WM_SETREDRAW,1,0) EndFunc But, it remains still too slow for my needs. You can hardly do faster than that. This is in principle the same as _GUICtrlListView_AddItem(). My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
Authenticity Posted August 12, 2009 Posted August 12, 2009 _WinAPI_PostMessage() seems to be faster if you're not expecting to receive the result.
Yashied Posted August 12, 2009 Posted August 12, 2009 _WinAPI_PostMessage() seems to be faster if you're not expecting to receive the result.Not to be the overflow? My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
Michel Claveau Posted August 12, 2009 Author Posted August 12, 2009 Hi! You can hardly do faster than that. This is in principle the same as _GUICtrlListView_AddItem().Ok, but, in the doc of _GUICtrlListView_AddItem, I read: "You can not use this function to insert subitems"and "Use _GUICtrlListView_AddSubItem" but this is very very slow, even if it is hard(trans)coded.Добрый вечер (je ne parle pas russe ; merci à Reverso)
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