Page 2 of 2
Re: Lag when typing
Posted: 17.11.2023 15:10
by w3mbox2
main Alexey wrote: ↑17.11.2023 14:43
to detect that lexer is the 'reason for slowliness', turn off the lexer (statusbar click). compare the speed when none lexer is active: statusbar shows '(none)' .
I can confirm that disabling the Java lexer did speed up things a lot in the old Windows XP computer. CudaText becomes very responsive. The source code file has only 2000 lines.
I hope that this observation can help you optimize CudaText in the future.
Re: Lag when typing
Posted: 17.11.2023 15:17
by main Alexey
you can create the 'lite lexer' for Java.
https://wiki.freepascal.org/CudaText#Lite_lexers
this way speed will be good and syntax-coloring will be partly ok (without multi-line comments).
Re: Lag when typing
Posted: 17.11.2023 15:30
by w3mbox2
main Alexey wrote: ↑17.11.2023 15:17
you can create the 'lite lexer' for Java.
https://wiki.freepascal.org/CudaText#Lite_lexers
this way speed will be good and syntax-coloring will be partly ok (without multi-line comments).
Other editors like Notepad++ and Geany do not have this problem. Maybe an opportunity to optimize CudaText ?
Re: Lag when typing
Posted: 17.11.2023 15:45
by main Alexey
i would like to do it. first I need to see the lag. I don't see it on Java lexer! I got 1700-lines java file, I hold a key in the beginning of the file, or at the end - no lag at all for me.
my CPU: Intel Core i3 3GHz.
Re: Lag when typing
Posted: 18.11.2023 08:47
by main Alexey
i am not sure here, but:
try to change the option "renderer_anti_flicker" to 15...40.
not sure it can help here, but try it.
Specifies the delay to reduce flickering on editing. [has suffix]
Value 0: feature is disabled.
Value 1...999: it's timer delay in milliseconds. 15...40 seems OK for slow systems.
Value 1000: use special anti-flickering code, works better on some systems.
Re: Lag when typing
Posted: 19.11.2023 19:24
by mix-7
Please give an example of CudaText lags
I don't see any lags
How to reproduce them?
Re: Lag when typing
Posted: 19.11.2023 20:45
by main Alexey
@mix-7
We should ask what CPU user has. after that, we must use that CPU (and maybe Windows XP? no, windows 10 is OK) and test 1000-lines Java file with Java lexer.
example of file:
https://github.com/Alexey-T/lexer_tests ... eting.java