can anybody help? How to load big files (2-5 MB) into SynEdit/UniSynEdit and do not let application get stuck, to make fast work? Is there virtual mode?
Thanks!!!
can anybody help? How to load big files (2-5 MB) into SynEdit/UniSynEdit and do not let application get stuck, to make fast work? Is there virtual mode?
Thanks!!!
If resizing is slow, the problem is not loading, but rendering. Text is already in memory, but the component has to compute each line beginning on screen. If this part of the editor is not optimized, it could be slow (especially if it does allocate a lot of small strings for each line or word on screen).
The bottleneck of this component is when you use text word wrapping: the TSynWordWrapPlugin.DoWrapLine
method '(doing all the work) do rely on the highlighter and will tokenize all text. I suspect that with a profiler, you'll see that most time is spent here. But I don't see any other way of handling it, without a major code modification. There is no so called "virtual mode" in SynEdit: it loads all and renders all lines in memory.
You could try the Letterpress version, which claims to be faster than original SynEdit. But it uses the same wrapping logic, so I guess there won't be a huge difference.
If you are using a Delphi 6 - 7 version of the compiler, please use FastMM4 as your memory manager: SynEdit does a lot of memory allocation, and the older BorlandMM is much slower than FastMM4. With modern version of Delphi, FastMM4 is the default MM (Memory Manager).