I’ve recently taken liking to Notepad2, a Windows app that uses scintilla.

 

However, I discovered that searching through ASCII files without regular expressions is VERY slow.

 

If I convert them to UTF8, the search is fast.

 

I believe the cause is in Document::MovePositionOutsideChar() when UTF8 is not the codepage.

 

In that case, the position check is set to the beginning of the line, making Document::FindText obscenely slow, especially on large files.  With a 7MB text file, a simple failed search can take over 30 seconds.

 

Now, I don’t totally understand the code in MovePositionOutsideChar(), but I’m willing to guess that it doesn’t make sense to reset the posCheck back to the beginning of the line if mbSize is 1.

 

Or maybe the function needs special handling for ASCII (codepage 1252), since the only double-byte character is CRLF anyway, the endlinecheck at the top of the function seems sufficient.

 

 

_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Reply via email to