[RC3] Composition mode performance issue

User avatar
mattarmon
Posts: 33
Joined: Mon Sep 23, 2019 9:15 am
Platform: Windows
Contact:

Sun Apr 19, 2020 4:44 pm Post

Scrolling text while in composition mode lags A LOT. See attachment for CPU measurament while scrolling.

It doesn't seem related to the amount of text (just 700 words) but to the amount of notes attached to the text, because another document with 1400 words (and no notes) scrolls just fine. It's just a blind guess.

Also, the typing of the text becomes a pain, laggy as hell.
Attachments
cpu.png
cpu.png (5.37 KiB) Viewed 1061 times

User avatar
xiamenese
Posts: 4424
Joined: Mon Jan 29, 2007 1:32 am
Platform: Mac
Location: London or Exeter, UK.

Sun Apr 19, 2020 10:09 pm Post

It is a known case that documents with many comments or inspector footnotes cause delays, not just in composition mode. See other threads here.

:)

Mark
The Scrivenato sometimes known as Mr X.
iMac 27" (late 2015) 10.15.6, 24GB RAM, 512GB SSID
MBP17" (late 2011) 10.13.6, 16GB RAM, 2TB SSID
2017 iPad, iPadOS 14, 128GB, Apple Pencil
Scrivener, Scapple, Nisus Writer Pro, Bookends …

User avatar
mattarmon
Posts: 33
Joined: Mon Sep 23, 2019 9:15 am
Platform: Windows
Contact:

Tue Apr 21, 2020 9:35 pm Post

xiamenese wrote:It is a known case that documents with many comments or inspector footnotes cause delays, not just in composition mode. See other threads here.

:)

Mark


Four notes are not that much :D

However, could the performance issue related to touchscreen devices? Scrolling and editing in composition mode seems fine, unless on a touch-enabled device.

rw
rwfranz
Posts: 985
Joined: Thu May 28, 2015 9:41 pm
Platform: Windows

Tue Apr 21, 2020 9:54 pm Post

mattarmon wrote:However, could the performance issue related to touchscreen devices? Scrolling and editing in composition mode seems fine, unless on a touch-enabled device.

I don't know why that would be, except the Windows drivers for them might not have the best settings for Scrivener? I think Scrivener doesn't mess with devices itself, deferring to Windows for those functions. (mouse, keyboard, etc)
Just another user.

User avatar
mattarmon
Posts: 33
Joined: Mon Sep 23, 2019 9:15 am
Platform: Windows
Contact:

Wed Apr 22, 2020 8:35 am Post

rwfranz wrote:
mattarmon wrote:However, could the performance issue related to touchscreen devices? Scrolling and editing in composition mode seems fine, unless on a touch-enabled device.

I don't know why that would be, except the Windows drivers for them might not have the best settings for Scrivener? I think Scrivener doesn't mess with devices itself, deferring to Windows for those functions. (mouse, keyboard, etc)

It doesn't need to have anything to do with drivers. Scrivener could have an event handler firing only when something behind the lines like a "IsTouchEnabled" property equals to true, and such handler could have poorly implemented code that wastes tons of CPU time.

That's my blind guessing, though, because I cannot think anything else causing such poor performance. Any other app on such device (photoediting, developer-oriented, videogames, etc...) run smoothly. Why on earth a text editing app would lag while scrolling or editing a text made of few thousand words?

Also, Word let me scroll a document of 600+ pages and 800 notes without any problem at all on the very same machine.

Last, but not least, the performance is degraded in composition mode only (or noticeable enough). That's a code smell.

User avatar
mattarmon
Posts: 33
Joined: Mon Sep 23, 2019 9:15 am
Platform: Windows
Contact:

Tue Apr 28, 2020 10:05 pm Post

RC5 and performances of Composition mode are still awful on my Surface (touch-capable) device.

User avatar
mattarmon
Posts: 33
Joined: Mon Sep 23, 2019 9:15 am
Platform: Windows
Contact:

Sat Jun 06, 2020 11:40 am Post

RC6 and composition mode is still unusable on my Surface. It consumes tons of CPU (about 40%) making it laggy as hell. Closing composition, CPU turns back to normal and Scrivener is fast as usual.

Is there any log/info I can share to help you fix this? It's REALLY annoying, since traveling and writing (on my Surface) is a pretty common scenario in my case.

User avatar
jje
Posts: 354
Joined: Sun Jul 06, 2014 5:57 pm
Platform: Windows
Location: Sussex, UK

Sun Jun 07, 2020 10:33 am Post

mattarmon wrote:RC6 and composition mode is still unusable on my Surface. It consumes tons of CPU (about 40%) making it laggy as hell. Closing composition, CPU turns back to normal and Scrivener is fast as usual.

Is there any log/info I can share to help you fix this? It's REALLY annoying, since traveling and writing (on my Surface) is a pretty common scenario in my case.


Any chance you could give a few more details of your system (e.g. processor type, speed; how much RAM, etc.?) I have a desktop with a Core i7-6700, 3.4ghz, 16GB of RAM and am not seeing what you describe at all (CPU utilisation doesn't go above 10% even with a series of documents in Scrivenings mode open in the composition mode).

Maybe the touchscreen drivers? I don't have a Surface any more, but I notice Microsoft keep doing updated drivers and firmware for them. So perhaps that's worth checking (if you haven't already, obviously).

User avatar
Jestar
Posts: 339
Joined: Sun Feb 19, 2017 6:51 pm
Platform: Mac + Windows

Sun Jun 07, 2020 6:23 pm Post

jje wrote:Any chance you could give a few more details of your system (e.g. processor type, speed; how much RAM, etc.?) I have a desktop with a Core i7-6700, 3.4ghz, 16GB of RAM and am not seeing what you describe at all (CPU utilisation doesn't go above 10% even with a series of documents in Scrivenings mode open in the composition mode).

Maybe the touchscreen drivers? I don't have a Surface any more, but I notice Microsoft keep doing updated drivers and firmware for them. So perhaps that's worth checking (if you haven't already, obviously).

Tested this out on my Surface Pro and did not have the issue either. Here is what I have hardware and OS-wise:
Annotation 2020-06-07 111845.png
System
Annotation 2020-06-07 111845.png (26.85 KiB) Viewed 510 times
Just a small 256GB SSD to hold things. I occasionally have choppy scrolling when using my fingers to do so, but prefer to use an external mouse or the stylus - the stylus seems to track better than the finger method. I also noticed that changing the screen resolution and scaling percentage affects the precision of the touch screen. YMMV.
Win 10 Ent. 64-Bit 2004
Intel Core i7-2600 @ 3,4 GHz (Quadcore) 32 GB RAM
Samsung SSD 860 EVO 500GB
NVIDIA Quadro K600
Scrivener Version: Version: 1.9.16.0 - 14 Nov 2019 & Version: 2.9.9.9 Beta (1017011) 64-bit - 14 Aug 2020

Ji
JimRac
Posts: 1722
Joined: Wed Aug 27, 2014 2:06 pm
Platform: Win + iOS

Sun Jun 07, 2020 6:55 pm Post

Yeah, composition mode runs fine on my touch-enabled Lenovo ThinkPad X1 Yoga gen3, for any of the RC versions. My system specs are identical to Jestar's, except I'm running Win10 Pro.

Documents with lots of comments take longer to load into the editor, but also run fine in composition mode.

Best,
Jim
I’m just a customer.

User avatar
mattarmon
Posts: 33
Joined: Mon Sep 23, 2019 9:15 am
Platform: Windows
Contact:

Sat Jun 13, 2020 10:41 am Post

Jestar wrote:Tested this out on my Surface Pro and did not have the issue either. Here is what I have hardware and OS-wise:
Annotation 2020-06-07 111845.png Just a small 256GB SSD to hold things. I occasionally have choppy scrolling when using my fingers to do so, but prefer to use an external mouse or the stylus - the stylus seems to track better than the finger method. I also noticed that changing the screen resolution and scaling percentage affects the precision of the touch screen. YMMV.


My specs are pretty similar to yours, except I have 16 GB of RAM (can't remember the specific CPU model atm, but it's a i5 for sure).

I'm really puzzled about the awful performances in this case. Everything is fine (CPU at 8% in Idle) and then it rockets to sky high (around 20/40%) the whole time I'm in Composition mode. It's not something related to scrolling only. Typing also gets sluggish performances.

At this point, it could be something related to drivers... Funny thing is, games and other apps runs fine. What on earth could Scrivener request to my hardware to cause such trouble on my config? :D

User avatar
Jestar
Posts: 339
Joined: Sun Feb 19, 2017 6:51 pm
Platform: Mac + Windows

Sun Jun 14, 2020 4:21 am Post

mattarmon wrote:My specs are pretty similar to yours, except I have 16 GB of RAM (can't remember the specific CPU model atm, but it's a i5 for sure).

I'm really puzzled about the awful performances in this case. Everything is fine (CPU at 8% in Idle) and then it rockets to sky high (around 20/40%) the whole time I'm in Composition mode. It's not something related to scrolling only. Typing also gets sluggish performances.

At this point, it could be something related to drivers... Funny thing is, games and other apps runs fine. What on earth could Scrivener request to my hardware to cause such trouble on my config? :D

At rest, no Scrivener project(s) open, I have less than 2% CPU though my RAM is hovering at ~80% usage (includes MS Teams and VPN software running in background/standby mode). It is interesting to note that opening Scrivener only gives a slight blip to RAM usage that almost immediately goes away (well, back to normal of 80%) and the CPU rises only slightly on average - quick blips then back to the baseline. Looking at the process monitor shows Scrivener's maximum CPU utilization only goes up to about 3% total - and I have to work at it to do that by opening and closing menus and switching rapidly between various views. I've never been able to get above that 3% mark for average CPU usage. Just all sorts of weirdness with the Surface Pro.
Win 10 Ent. 64-Bit 2004
Intel Core i7-2600 @ 3,4 GHz (Quadcore) 32 GB RAM
Samsung SSD 860 EVO 500GB
NVIDIA Quadro K600
Scrivener Version: Version: 1.9.16.0 - 14 Nov 2019 & Version: 2.9.9.9 Beta (1017011) 64-bit - 14 Aug 2020

User avatar
mattarmon
Posts: 33
Joined: Mon Sep 23, 2019 9:15 am
Platform: Windows
Contact:

Tue Jun 16, 2020 10:53 pm Post

Looks like I might have found the source of performance degradation.

I have a background image set in composition mode and usually a little bit of paper fading. Removing it completely (setting the paper to have no transparency at all) seems to greatly improve the overall performance. (still a little bit sluggish, but bearable somehow)

To devs: could you guys take a look at this? We all know opacity it's quite expensive, but seems a little bit too much in this case. Again, on the very same hardware, I can play many hi-res 2D games without any fps drop. Maybe there is some piece of code consuming way too much resources?

I'm so picky because I'm a programmer myself by day, so please excuse my pressure on this subject :D

User avatar
tiho_d
Posts: 1239
Joined: Tue Sep 13, 2011 1:14 pm
Platform: Linux + Windows

Wed Jun 17, 2020 1:39 am Post

It seems this forum has more developers than writers. :-)

User avatar
tiho_d
Posts: 1239
Joined: Tue Sep 13, 2011 1:14 pm
Platform: Linux + Windows

Wed Jun 17, 2020 1:44 am Post

Games use OpenGL, DirectX and other suitable technologies. Scrivener is not using these.
Try hiding the main Window via the Options setting and test if it helps. You can also try using a smaller image in size as a Composite background.