Created attachment 152926 [details] gdb trace This bugreport concerns kate-22.08.1 Website https://profiler.firefox.com/ generates a big single line JSON file. In my case the dimension is ~40 MB. Kate is not able to open it, and it will get stuck. I noticed that it can happen also with smaller files (8 MB). I managed to get some parts of GDB debugging. some may get lost since GDB has tried to print content of the huge file in standard output, exceeding Yakuake unlimited scroll limit. By running GDB again I should have been to reconstruct the GDB output SOFTWARE/OS VERSIONS Linux/KDE Plasma: Fedora 36 KDE Plasma Version: 5.25.5 KDE Frameworks Version: 5.98.0 Qt Version: 5.15.6
Developer's note: This is related to the way QRegularExpression works in Qt5: the text is copied for each call to match(QStringView) in syntax-highlighting: https://codebrowser.dev/qt5/qtbase/src/corelib/text/qregularexpression.h.html#_ZNK18QRegularExpression5matchE11QStringViewiNS_9MatchTypeE6QFlagsINS_11MatchOptionEE Qt6 does not have this defect. With kate-syntax-highlighter --output-format=ansi256colors and a json of 1.9M, it takes 45s with Qt5, but less than 1 second with Qt6.
QString::fromRawData()'s document explains how to avoid copies with QRegularExpression, but there is a bug in Qt5 which will not be fixed: https://bugreports.qt.io/browse/QTBUG-108302