| Summary: | UI reacts noticably slow while typing inside an open file on an NFS share | ||
|---|---|---|---|
| Product: | [Applications] kate | Reporter: | Katalin Rebhan <me> |
| Component: | application | Assignee: | KWrite Developers <kwrite-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | christoph |
| Priority: | NOR | ||
| Version First Reported In: | 24.12.3 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/frameworks/ktexteditor/-/commit/13972aefd78ccb25a85318f6ebd0afac0b191ab0 | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
|
Description
Katalin Rebhan
2025-03-14 21:36:31 UTC
Mnn, if the swap files are off, that is strange. It would be interesting where that happens, if you could run Kate in some profiler like 'hotspot' and tell where the most time is spend that would perhaps show the bottleneck. (In reply to Christoph Cullmann from comment #1) > Mnn, if the swap files are off, that is strange. It would be interesting > where that happens, if you could run Kate in some profiler like 'hotspot' > and tell where the most time is spend that would perhaps show the bottleneck. Trying it again, it does seem related to the swap files, my bad. Just disabling them and testing right away doesn't work which is why I didn't catch it initially, you have to close and reopen the file for the freezes to go away after setting it to either disabled or storing them in a custom local directory. This is strange though, since it's set to "Save swap files every 15s". Why does this setting do something on every key press? Also, should I still attach the generated perf.data file from hotspot? Not sure I'm doing this right since I'm not seeing a relevant function. Most of the time seems to be spent in the UI drawing code in libQt6Gui and I'm not seeing any IO calls anywhere. Could be that io wait will not show properly in the hotspot files. Not sure why the 15 seconds setting doesn't help needs to be investigated. I inspected the code, I see no reason why we should flush more often than once per interval, we even use just one global timer for all files. We do flush after each edit. We sync on each sync interval. We could try to move the flush to the place we sync. I will take a look. https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/798 Can you test that branch? (In reply to Christoph Cullmann from comment #8) > https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/798 > > Can you test that branch? I applied the patch to ktexteditor 6.12.0 and looks like that fixes it. I realized I could turn on NFS debugging to look at the operations, and there: Without the patch (one write for each character typed): > [ 4218.028400] NFS: fsync file(saiko/.Test.txt.kate-swp) datasync 1 > [ 4218.031784] NFS: write(saiko/.Test.txt.kate-swp, 16@20494) > [ 4218.119789] NFS: write(saiko/.Test.txt.kate-swp, 16@20510) > [ 4218.178227] NFS: write(saiko/.Test.txt.kate-swp, 16@20526) > [ 4218.228303] NFS: write(saiko/.Test.txt.kate-swp, 16@20542) > ... > [ 4232.747619] NFS: write(saiko/.Test.txt.kate-swp, 16@24622) > [ 4232.892042] NFS: write(saiko/.Test.txt.kate-swp, 16@24638) > [ 4233.039792] NFS: write(saiko/.Test.txt.kate-swp, 16@24654) > [ 4233.139649] NFS: fsync file(saiko/.Test.txt.kate-swp) datasync 1 With the patch (every 15s only right before the fsync): > [ 4372.943790] NFS: write(saiko/.Test.txt.kate-swp, 6864@5422) > [ 4373.150276] NFS: fsync file(saiko/.Test.txt.kate-swp) datasync 1 > [ 4387.943589] NFS: write(saiko/.Test.txt.kate-swp, 6496@12286) > [ 4388.170490] NFS: fsync file(saiko/.Test.txt.kate-swp) datasync 1 Thanks! Git commit 13972aefd78ccb25a85318f6ebd0afac0b191ab0 by Christoph Cullmann. Committed on 22/03/2025 at 14:44. Pushed by cullmann into branch 'master'. Try to flush less often to disk Bundles flush with sync, avoid stall on nfs. M +8 -8 src/swapfile/kateswapfile.cpp https://invent.kde.org/frameworks/ktexteditor/-/commit/13972aefd78ccb25a85318f6ebd0afac0b191ab0 Thanks for testing this. |