Question

I currently use TRichEdit as an 'real time' event log viewer in one of my software (in Delphi 7) and I recently profile my software and TRichEdit is consuming more than 40% of the software cpu time.

I just want to test other components in order to compare performances, this component must have :

  • Line Coloring (it may be LINE syntax color, since different colors lines have different prefixes Or HTML coloring etc.).
  • Easy Save to file function (to RTF or to HTML).
  • Free or Open source.
  • Good perf. even for 'large files' (may be 200 Mo) as viewer.

Info : I yet look at this post but without good answer for me.

Was it helpful?

Solution

Check out TConsole / TColorConsole circa 1996: http://www.torry.net/authorsmore.php?id=604

It doesn't do HTML, it doesn't do RTF, but it does do scrolling colored text pretty darned fast. ;>

OTHER TIPS

For 'real time' event log viewer I'd recommend using VirtualTreeView. It is capable of handling virtually unlimited number of rows, has tremendous amount of customization features (like custom coloring and custom drawing anything and everything), supports unicode and works extremely fast even with several million items already in the list. It does take some time to understand how everything works, but once you figure it out, you will never look back. It even supports in-place editing (including support for custom controls for every column). Every item is a record which can hold whatever data you need (not just the data you want to display). Incremental search is also supported, as well as extremely fast search from code, doesn't matter even if you have millions of items.

I'd avoid using any kind of 'standard' text editing components because of many restrictions imposed either by OS or by component itself. The only component I know of that can support most (if not all) of your requirements is already mentioned - TRichView. I've tried TSynEdit and I can say that it has a lot of features but seriously lacks performance.

Try VirtualTreeView and you won't regret it.

Maybe you can log to a clientdataset. The DBGrid allows you to specify all kinds of drawing options, so you can specify a background color based on the visible lines. The ClientDataset can easily manage quite a lot of data, and the grid will only draw those rows that are visible.

Anyway, if you log a lot, constantly redrawing the logging component will slow down the application. Perhaps you should make the log less realtime by caching lines in a temporary log and add them in bulk to the visible log every few seconds.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top