https://bugs.kde.org/show_bug.cgi?id=448353

nyanpasu64 <nyanpas...@tuta.io> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nyanpas...@tuta.io

--- Comment #2 from nyanpasu64 <nyanpas...@tuta.io> ---
Created attachment 146377
  --> https://bugs.kde.org/attachment.cgi?id=146377&action=edit
2000 line files with LF and CRLF endings. kdiff3 is fast on LF and slow on
CRLF.

I ran into this slowness when I cloned a repo with CRLF endings (not my repo,
not my decision), then ran `git difftool` which triggered kdiff3. It turns out
that kdiff3 is far slower for CRLF line endings than LF. See the attached file.

I ran a perf analysis, showing an unusually high amount of time spent in
SourceData::FileData::preprocess(). Hotspot showed that most time was spent on
lines lines 668, 664, and 680
(https://invent.kde.org/sdk/kdiff3/-/blob/1.9.4/src/SourceData.cpp#L664-680). I
think line 680 is incorrect, since Hotspot says that 95.9% of cycles were spent
calling QTextStream::pos().

My guess is that you call QTextStream::pos() O(file length) times, and each one
takes O(file length) time to complete.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to