Re: Slow response when calling Fl_Text_Editor::buffer()
"'Albrecht Schlosser' via fltk.general"
Apr 19, 2024
On 4/19/24 15:43 Eric Sokolowsky wrote:
I have been experiencing slow performance when using
Fl_Text_Editor in my application. I see a significant delay
(some 7 seconds) when calling Fl_Text_Editor::buffer on a new
Fl_Text_Buffer when my application starts. Is this normal
behavior? I'm just so used to FLTK working almost instantly
for every operation that this was surprising to me. I'm using
FLTK 1.3.4 because I cannot right now move to a newer version
of FLTK, because of system dependencies. Here's a snippet of
the code I use, together with some debugging output so I could
tell why it was being slow:
[...]
As you can see, the delay comes from the line where the
editor is given the text buffer to use. Everything else is
fast, as expected.
Any light that could be shed on this would be appreciated.
Eric, the FLTK version (1.3.4) you are using is more than 7 years
old which means that the issue you are reporting would very likely
have been fixed long ago. It's very surprising that the buffer
assignment alone would cause a delay of almost 7 seconds.
I would have suggested you to create a small, complete (i.e.
compileable) example program that shows the issue, and that you test
this program with a newer FLTK version, either 1.3.9 or 1.4.0 (git).
But then I decided to copy and modify your code snippet and to try
it myself. I removed only one statement and all the timer lines.
Result: I can't confirm the issue, neither with 1.3.4, 1.3.9 nor
1.4.0.
Here's my demo program with test results using 1.3.4 (built for this
test!) and 1.4.0:
```
I noticed that 1.4.0 was "significantly slower" (by about 0.12 sec,
which is not much), but 1.3.4 was really fast in all my tests. Note
that I ran all this on my Debian 10 (Bookworm) Linux system with a
recent CPU.
There must be something weird with your system. Please run my test
program and report your results. If you still see slow behavior with
this test program, please give us more information about your
system.
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.