On Sun, 21 Jan 2007 10:44:32 +0300
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;
    StringGrid1.Cells[0,i-1]:=IntToStr(i);
    for j:=1 to 10 do begin
      StringGrid1.Cells[0,i-1]:=IntToStr(i)+','+IntToStr(j);
    end;
  end;
  StringGrid1.EndUpdate;

About: Who wants to see 30.000 lines?
Answer: No one. But compiling a quickly ported Delphi lib creates
easily thousand of hints, notes and warnings.
And those poor windows users without a proper terminal who
set -vt or even -va to debug a 'unit not found' error.
It would be good, if the message window would already supports
filtering and sorting. But it does not yet and we are talking about an
easy replacement.
By the way, eventually I will implement filtering and sorting for
the message window and then a tree like control will be needed anyway.
So, I guess, I will replace the TListBox with a TTreeView.


Mattias

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

Reply via email to