-
-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typing - letter rendering lagging #2129
Comments
There are three things running while you type: Auto-replace features, spell checking, and syntax highlighting. To check if any of these are the cause, you can turn off as much as possible of these in Preferences. If turning them off have no effect, then there is likely another cause, which may be trickier to find. There are some changes to syntax highlighting in 2.6. Mainly the new dialogue highlighting for languages that use dashes as dialogue markers. These are only enabled when these Preferences are set. There is also a minor change to auto-replace where an additional dash was added, but overall, there isn't much change since 2.5. |
Okay, I follow your recommendation - thank you for your help. |
Did changing any settings make a difference? |
Yes, in my case the auto-replace, was the culprit. Apologies for not letting you know earlier. |
Sure, no problem. The auto-replacer keeps growing slowly. and there's quite a lot of code to run through on each keypress. I'll look into optimising it a little. |
Hmm, with English settings, it takes about 30 microseconds to process on my laptop. That shouldn't be noticeable. What kind of auto-replace settings did you have? Any of the special French/Spanish ones that inserts spaces around punctuation? |
UK English only, spell check on and nothing much else. Syntax highlighting on did not affect it, only the auto-replace. It may even be my small desktop computer? Windows 10 System Type: x64-based PC Processor:Intel(R) Celeron(R) J4125 CPU @ 2.00GHz, 2001 Mhz, 4 Core(s), 4 Logical Processor(s). I am in the process of moving my work over from Scrivener, but that is idle as I work in novelWriter. |
It could just be processing priority or something like that. novelWriter is designed to be light on resources, but Python is also fairly slow, so anything that requires real-time processing as you type can potentially be an issue. Since the problem is intermittent, I expect resources do play a role here. I also get the impression the whole framework novelWriter runs on is a little slower on Windows than on Linux. So it may very well be that it's not a matter of how fast the auto-replace feature can run, but the fact that it has to run in the same thread as the text rendering. That's a Qt requirement, and unavoidable. So optimising the code might not help, as the problem may be that this part of the code has to run at all. If that makes sense. Do these intermittent delays coincide with either auto-save (every 30 seconds by default) or word counting (every 5 seconds by default)? Edit: Word counting does run in a separate thread, but it does a partial save process ahead of the count to extract the text to process, so there is still a small interruption. Most of these interruptions have been timed, and should in most cases be in the microseconds range, which is not on its own perceptible as a delay. |
The settings are default, save document 30 seconds, word counting 5 seconds. I will moving over to Linux Mint in the near future, this is my reason for dumping Scrivener (apart from it being too bloated an application) so it is good to know that it work better on Linux. I think that move may be quicker that I anticipated? |
I tested this on a Windows virtual machine, so a fairly low resource environment, and I can reproduce your issue. However, I cannot make it go away by turning off auto-replace. I suspect this has nothing to do with the auto-replace itself, but a rendering delay. There were minimal resource usage, and the auto-replace took nowhere enough time to cause the delay. Perhaps turning it off in your case keeps it just below the threshold where it starts lagging. A little web search revealed similar reports on Windows, even on minimal example code, so this may be Qt-related. It's hard to say. I would like to hold off on these kind of potential Qt-related issues until novelWriter moves to Qt6, which may or may not fix some of them. It will be a good jump forward in versions. The plan is to make the switch in 2.7, ahead of the Qt5 end of life in May. |
Hi,
I’m currently using Version 2.6 Beta 1 on Windows 10 and have noticed occasional lags while typing. There’s a noticeable delay between typing and the text appearing on the screen. This issue is specific to this application, as other programs on my computer are functioning normally.
Thank you for your assistance.
The text was updated successfully, but these errors were encountered: