On Sun, 21 Jan 2007 17:37:20 +0300
Al Boldi <[EMAIL PROTECTED]> wrote:

> Mattias Gaertner wrote:
> > Al Boldi <[EMAIL PROTECTED]> wrote:
> > > Vincent Snijders wrote:
> > > > Jesus Reyes schreef:
> > > > > --- Al Boldi <[EMAIL PROTECTED]> escribiظژ:
> > > > >> TListBox:     10k rows in 73sec
> > > > >> TTreeView:   100k rows in 50sec
> > > > >> TMemo:       100k rows in 30sec
> > > > >> TListView:   100k rows in 1.5sec
> > > > >> TStringGrid: 100k rows in 0.5sec
> > > > >
> > > > > Are you sure?, this doesn't match with Mattias mail.
> > > >
> > > > Al, did you set the focused row to the last added rows after
> > > > each 10 rows?
> > >
> > > Here is the code:
> > > ============================
> > >   StringGrid1.RowCount:=100002;
> > >   i:=0;
> > >   repeat
> > >     inc(i);
> > >     StringGrid1.Cells[0,i]:='tst'+inttostr(i);
> > >   until i>100000;
> > > ============================
> >
> > The component is updated several times a second to give the user
> > visual feedback during the compilation progress. At the moment
> > every read line is either added to the TListBox or replacing the
> > last line of the TListBox. So changing RowCount would be called
> > every added line. The message window is using Begin/EndUpdate. It
> > calls them about three times a second. So basically there are a lot
> > of 'change last item', many adds and several Begin/EndUpdates.
> > That's why I tried:
> >
> >   StringGrid1.ColCount:=1;
> >   StringGrid1.BeginUpdate;
> >   for i:=1 to 100000 do begin
> >     StringGrid1.RowCount:=i;
> 
> This line basically kills TStringGrid.

Yes, but the IDE does not know the number of lines in advance.
Of course it would be possible to write a wrapper to add in bigger
chunks.


> TStringGrid gains it's speed from preallocating the list.
> 
> Preallocating the tree in TTreeView could improve its speed a lot.

I doubt that. It already works with exponential growth.
I still wonder why your treeview times are so much slower than mines.
Did you use Begin/EndUpdate?


Mattias

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to