Open bird00101011 opened 4 months ago
No algorithms are implemented to improve performance for large documents. Each change to a document results in a complete recalculation of all document metrics. However, for most documents (<50 A4 pages), this response should be reasonably short.
I have use this code fixed it.
try
KMemo1.Blocks.LockUpdate;
while BlockNo < Kmemo1.Blocks.Count do begin
SomeCrazyProcedure(KMemo.Blocks.Items[BlockNo]);
inc(BlockNo);
end
finally
KMemo1.Blocks.UnlockUpdate;
end;
https://wiki.lazarus.freepascal.org/KControls/KMemo_notes [Locking chapter].
Thanks for ur reply.
Yep, I thought you were talking about the slowness of Unlockupdate. This method is known to be slow for large documents. In certain situations (like typing new text) there should not be the need to recalculate entire document metrics all the time. These are the algorithms I was talking about, which are not implemented yet.
When I insert multiple texts, or when the text content is too large, the insertion efficiency becomes very low