Bug 466982 - Merely having some large files open, sitting there doing nothing, causes Xorg to consume a lot of CPU
Summary: Merely having some large files open, sitting there doing nothing, causes Xorg...
Status: RESOLVED WORKSFORME
Alias: None
Product: kate
Classification: Applications
Component: application (show other bugs)
Version: 22.12.2
Platform: Manjaro Linux
: NOR major
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-07 00:01 UTC by php4fan
Modified: 2023-03-30 18:34 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description php4fan 2023-03-07 00:01:36 UTC
SUMMARY


STEPS TO REPRODUCE
1. I opened two arguably large files (200K lines each) in Kate in two tabs
2. (probably irrelevant: at some point I copied the contents of each and pasted them somewhere else)
3. I left the two files open in kate, sitting there doing nothing with them. Most of the time I wasn't even using Kate. From time to time I would be editing other files in kate in other tabs (in the same window), never giving focus to the two tabs where the large files were opened.

OBSERVED RESULT

For several hours continuously, probably since the moment I opened the two files, to when I closed them, the Xorg process was consuming 30% CPU all the time.

For many hours It didn't even cross my mind that it could be Kate. 

EXPECTED RESULT

Having a file open in an unfocused tab doing absolutely nothing, no matter how big the file, should have absolutely zero impact on CPU consumption. With syntax highlight, I can expect some sluggishness when I'm actually modifying the contents of the file (not even when scrolling), or I don't know, maybe searching. But definitely not when the problematic file is not even in the currently focused tab.

SOFTWARE/OS VERSIONS
Operating System: Manjaro Linux
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Kernel Version: 6.0.19-3-MANJARO (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-1065G7 CPU @ 1.30GHz
Memory: 7.3 GiB of RAM
Graphics Processor: Mesa Intel® Iris® Plus Graphics
Manufacturer: LENOVO
Product Name: 81WE
System Version: IdeaPad 3 15IIL05
Comment 1 Waqar Ahmed 2023-03-30 18:34:22 UTC
I have tried and can't reproduce this. I regularly open large files in Kate and keep them open and haven't noticed any spikes

Perhaps this is a bug in X or elsewhere. 

If the file was open _and_ focused, it would be an issue in Kate especially if it is a large file with long lines. Drawing long lines can slow down Kate and can consume a lot of CPU.

Besides, consistent 30% CPU consumption is odd in itself with a CPU such as yours. And if that CPU isn't being consumed by Kate then we can't really do much. I would suggest discussing/redirecting this to X people instead. We can't do much here.