Re: GetDirectories Performance
- From: "Herfried K. Wagner [MVP]" <hirf-spam-me-here@xxxxxx>
- Date: Sun, 23 Apr 2006 01:32:24 +0200
"Tom Scales" <tjscales@xxxxxxxxx> schrieb:
I'm writing a VB.NET 2003 program that uses a Treeview to display the drive
structure on the computer. I am having a major problem with performance.
The are many files on one drive (over a million) and it is killing me. For
example, one directory has a structure:
Instead of populating the whole treeview control on startup, only add the nodes on the first level and check if the folders contain subfolders. If the latter is the case, add a dummy subnode to the node representing the folder. Then catch the node expand event and replace the dummy node with nodes for the actual files and folders contained in the folder. This should lead to acceptable performance and memory usage would be much lower than populating the whole control. In addition, in many cases it's very unlikely that the user will expand every single node and thus much less memory will be occupied by your application in total.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
.
- Follow-Ups:
- Re: GetDirectories Performance
- From: Tom Scales
- Re: GetDirectories Performance
- References:
- GetDirectories Performance
- From: Tom Scales
- GetDirectories Performance
- Prev by Date: GetDirectories Performance
- Next by Date: Re: Automagically answering another program's dialog
- Previous by thread: GetDirectories Performance
- Next by thread: Re: GetDirectories Performance
- Index(es):
Relevant Pages
|