[Lazarus] StringGrid performance problems

Graeme Geldenhuys graemeg.lists at gmail.com
Wed Nov 17 08:23:22 CET 2010


Op 2010-11-16 18:14, Lee Jenkins het geskryf:
>  applications, but against my judgment I figured I'd give lazarus 
> another go for a GUI app which was a mistake apparently.

Following up from Lee's post, but related to StringGrids. I too tried to
used LCL again, for a External Tracing/Debugging tool. My plans was to make
an executable for fpGUI and LCL. The latter giving users the native look
and feel and all that... I use StringGrid components a lot in my fpGUI
apps, so that was my first choice for the display component, but for some
reason I couldn't use it under the LCL version of my tool.

What does my app do. It works something like the "debug server" included
with Lazarus, but a lot more detailed with what it displays and how the
developer can manipulate the traced data. Log information comes in hard and
fast, and unlimited in volume - depending on what you are debugging of
course, and the amount of traces/logs you setup.

I then did a simple test to see what could be the cause of problems in the
LCL app (and why it looks frozen). I created a stringgrid with exact
dimensions, a single column. I then used a simple test method that
generates log entries (8 million to be exact - did start small though).
Each time a log is received, I do a BeginUpdate, add a new row to the grid,
populate the first cell with a number, then call EndUpdate. Under fpGUI
this test took 5 seconds to complete, MSEgui took 10 seconds (just for fun,
I tied MSEgui too). LCL took.... well, I kill the app after 3 hours of 100%
CPU load and still nothing being displayed. Thank goodness I have a quad
core, so the 100% load on one core did not affect my day-to-day work.

Anybody know about the performance problems in TStringGrid? Anybody tracked
down what exactly is causing its bad performance?  I can only assume the
problem is known, and the reason why Lazarus IDE itself uses a TreeView
instead of a StringGrid for the Messages window.

Should I report this in Mantis?

  - Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal

More information about the Lazarus mailing list