Hello,
for many years we have been using a normal TRichEdit to display logging in this form:
[Info][2019-02-15 15:15:14 828]…
[Warning][2019-02-15 15:40:29 174]…
[Error][2019-02-15 15:40:46 393]…
However, on Windows 10 we recently started encountering performance issues (application interface freezes). Apparently TRichEdit is not the most efficient component, especially when changing data in the beginning (like deleting the first line).
I started doing tests with TMS's TAdvRichEditor to see if we get better performance, but it does not seem to be better: in my tests on my laptop my interface starts freezing at arount 450 messages per second with TRichEdit and already at around 80 messages per second with a TAdvRichEdit.
The code I'm using is:
I started doing tests with TMS's TAdvRichEditor to see if we get better performance, but it does not seem to be better: in my tests on my laptop my interface starts freezing at arount 450 messages per second with TRichEdit and already at around 80 messages per second with a TAdvRichEdit.
The code I'm using is:
procedure addMTLogToAdvRe(const aAdvRe: TAdvRichEditor; const s: String; const aLvl: TMTLogLevel; const aLogTime: TDateTime; const aMaxLines: Word);
var
sNow, sLvl: string;
begin
aAdvRe.BeginUpdate;
try
aAdvRe.AddText(sLvl,MTLogLevelToColor(aLvl));//diplay loglevel
aAdvRe.AddText(sNow + s);//display time + text
aAdvRe.AddLineBreak;
//---limit to (100) lines (NYI for TAdvRichEdit)
//---scroll down
aAdvRe.SetCaret(cpEndDoc);
aAdvRe.ScrollToCaret;
finally
aAdvRe.EndUpdate;
end;
end;
Is there an other component I should be using for this to get better performance, or am I doing something wrong?
Is there an other component I should be using for this to get better performance, or am I doing something wrong?