Bug 439003

Summary: Clearing Run output view filter can be extremely slow if the view contains many lines
Product: [Applications] kdevelop Reporter: Igor Kushnir <igorkuo>
Component: Output ViewsAssignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: git master   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: https://invent.kde.org/qt/qt/qtbase/-/commit/b8841b34c5b90bf32394568102888ddc559f3ddc
Sentry Crash Report:
Attachments: Reproducing example

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.