Go to file
Todd Grunke 069b409dd4 Fix perf issue in LineTrackingStringbuffer.ScanLines.
I noticed several hundred ms spent in this method from a customer profile. Primarilly, the method was doing a linear scan of all lines trying to find one that contained the requested position. I changed this to a binary search, but kept/improved the optimization around checking next/previous lines before instigating the search.

Note, there was also a bug where the old code did:

else if (absoluteIndex > _currentLine.Index && _currentLine.Index + 1 < _lines.Count)

but it should have been coparing absoluteIndex with _currentLine.Start
\n\nCommit migrated from 32a0f28708
2020-05-07 17:35:41 -07:00
src Fix perf issue in LineTrackingStringbuffer.ScanLines. 2020-05-07 17:35:41 -07:00