[Qt-interest] Faster logfile viewer
Christoph Bartoschek
bartoschek at gmx.de
Wed Aug 5 00:57:45 CEST 2009
Arnold Krille wrote:
> You are calling repaint() which executes an immediate repaint. You should
> call update() which schedules the paintEvents in the event-loop.
> Replacing the repaint() with update() reduces the runtime significantly
> (in callgrind) and results naturally in much lower costs and only one
> effective paintEvent.
>
> In practice this change will not be a problem because normally the log-
> messages are coming distributed over time and there will be enough time to
> do a paintEvent every now and then.
>
> Unless you really want a log-_file_-viewer but in that case it should be
> far simplier to load the file as whole into the widget. Or at least in
> large chunks, not line by line.
Hi,
unfortunately using update() does not work. I have to explain the
application a little bit more:
It's a VLSI-application that executes operations that take several hours of
runtime during which the GUI is effectively blocked. There is only the
TextEdit with the logfile where the operations write status information to.
Normally this works fine but sometimes the operations want to write more
than 100000 lines in a very short time.
The resulting requirements are:
- Because one does not know when the next line has to be shown one cannot
merge several lines together and has to show each one separately.
- Because each line can be the last one for a longer time the widget has to
be updated after each line.
Our old GUI uses Motif and also colored lines. The updates are also after
each line but writing 10000 lines takes less than one second.
Christoph
More information about the Qt-interest-old
mailing list