Bug 439003 - Clearing Run output view filter can be extremely slow if the view contains many lines
Summary: Clearing Run output view filter can be extremely slow if the view contains ma...
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Output Views (other bugs)
Version First Reported In: git master
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-21 17:17 UTC by Igor Kushnir
Modified: 2021-06-22 09:59 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In: https://invent.kde.org/qt/qt/qtbase/-/commit/b8841b34c5b90bf32394568102888ddc559f3ddc
Sentry Crash Report:


Attachments
Reproducing example (325 bytes, text/plain)
2021-06-21 17:17 UTC, Igor Kushnir
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Kushnir 2021-06-21 17:17:31 UTC
Created attachment 139580 [details]
Reproducing example

SUMMARY
Because of a Qt performance bug, clearing the Run output view filter has O(N^2) complexity when there are N lines. The bug has been fixed in Qt 6.x by https://codereview.qt-project.org/c/qt/qtbase/+/341365. However the fix has not been cherry-picked to KDE's Qt5PatchCollection yet.

STEPS TO REPRODUCE
1. Execute the attached reproducing example in KDevelop
2. Enter the number equal to line_count/2 into the Run output view filter (250000 by default).
3. Click the clear button at the right end of the output view filter.

OBSERVED RESULT
Clearing the filter that matches the single middle line takes about 14 seconds on my system.

EXPECTED RESULT
Clearing the filter is instantaneous. This is indeed the case when a patched Qt version is installed.


SOFTWARE/OS VERSIONS
Manjaro GNU/Linux, Xfce
KDE Frameworks Version: 5.82.0
Qt Version: 5.15.2+kde+r196
Comment 1 Igor Kushnir 2021-06-22 09:59:13 UTC
The fix was just cherry-picked into https://community.kde.org/Qt5PatchCollection.