Massive tree View control 
Author Message
 Massive tree View control

I have a text file I need to load into a tree view control.  The file
has 500,000 lines of text.  27,000 will be the root items, the rest are
child items to these roots.  Even loading just the 27,000 root items and
not the child items takes a significant amount of time.

fp = fopen (load_file, "r");

while (Get_Next_Line(textString, fp))    //returns next line of text
from file
  {
    if (parent)
        {
        ret = Load_Tree_Item (textString, TVI_ROOT, Icon);
        }
  }

 fclose (fp);

Any suggestions on speeding this up?  Creating my own tree control, or
micro managing the control (only loading viewable portions) seems like
quite a task.
--
Topochicho



Tue, 14 Oct 2003 04:54:27 GMT  
 Massive tree View control
Quote:

>I have a text file I need to load into a tree view control.  The file
>has 500,000 lines of text.  27,000 will be the root items, the rest are
>child items to these roots.  Even loading just the 27,000 root items and
>not the child items takes a significant amount of time.

[snip]

Whatever are you trying to accomplish with this?  Are  you
actually expecting a user to make useful choices in a tree view
among 27K root items and a half meg of total items? I mean,
suppose the user could read five of these items per second.
You are still looking at an average linear search time of about
an hour, just for the root items.

If you are trying to get something useful out of this,
you are almost certainly going to want to do something besides
splash it up as a tree. Even if it comes up instantly, the user
is likely to hunt you down and slap you for this.

What is it your are trying to get to?
Dan Evens



Tue, 14 Oct 2003 06:03:09 GMT  
 Massive tree View control
This a diagnostic tool.  The tree control will interact with the drawing
area.  When a user clicks on an item in the draw area, the corrisdponing tree
element is pulled to the top of the  visible area and exploded.  There is a
also a filter system and a search system to allow the user to narrow down the
items listed, but to begin with I have to be able to show all the elements.

Quote:


> >I have a text file I need to load into a tree view control.  The file
> >has 500,000 lines of text.  27,000 will be the root items, the rest are
> >child items to these roots.  Even loading just the 27,000 root items and
> >not the child items takes a significant amount of time.
> [snip]

> Whatever are you trying to accomplish with this?  Are  you
> actually expecting a user to make useful choices in a tree view
> among 27K root items and a half meg of total items? I mean,
> suppose the user could read five of these items per second.
> You are still looking at an average linear search time of about
> an hour, just for the root items.

> If you are trying to get something useful out of this,
> you are almost certainly going to want to do something besides
> splash it up as a tree. Even if it comes up instantly, the user
> is likely to hunt you down and slap you for this.

> What is it your are trying to get to?
> Dan Evens

--
Topochicho
Houston, TX
00 Nomad FI Silver/Burgandy
Corbin Dual Tour
VROC #4938


Tue, 14 Oct 2003 22:12:52 GMT  
 Massive tree View control

Quote:

>This a diagnostic tool.  The tree control will interact with the drawing
>area.  When a user clicks on an item in the draw area, the corrisdponing
tree
>element is pulled to the top of the  visible area and exploded.  There is a
>also a filter system and a search system to allow the user to narrow down
the
>items listed, but to begin with I have to be able to show all the elements.

Sure. So you should do a filter before you blast that up on the screen.

Like, maybe you need a couple more levels to the tree so there are no more
than ten or twenty root items. For example, could you split the items up
alphabetically? So you would get root items A, B, C, etc. A tree structure
with 26 root items is manageable.  A tree structure with 27K root items is
just not even vaguely reasonable.  Or you could do it by date of entry. Or
some other key that matches your problem space.  Even something as trivial
as arbitrarily splitting the root data items into ten or twenty groups and
having each group as a root would make things much better.

Just keep in mind that a human faced with more than a couple dozen items to
hunt through is either going to get glazed eyes and go to sleep, or become
furious. Either way, they won't like you.

You might think about doing this in some entirely different way as well.
After all, if the tree view is too slow to load, think how long it will take
your user to make sense of the data in it. And how long it will take to get
frustrated with it and get other software. Maybe you don't want a tree view
at all? Maybe you just want to show the particular item and the few items
around it to give context?

Dan Evens



Tue, 14 Oct 2003 22:59:42 GMT  
 Massive tree View control

Quote:

>Even loading just the 27,000 root items and
>not the child items takes a significant amount of time.

I take it you're already using SetRedraw (FALSE) ?

--
Bob Moore [WinSDK MVP]
http://www.mooremvp.freeserve.co.uk/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Do not reply via email unless specifically requested to do so.
Unsolicited email is NOT welcome and will go unanswered.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Wed, 15 Oct 2003 05:35:21 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Basics of Tree Control and Tree view control

2. List View control and Tree View Control

3. Tree View and List View controls

4. Tree View control

5. Web Control - Tree View

6. tree view control

7. Changing tree control's view size

8. Tree View control

9. Changing tree control's view size

10. Always show selection on Tree control/view

11. Tree View control Root Item

12. tree view with children controls

 

 
Powered by phpBB® Forum Software