Improve skip offset handling, allow to skip full line on no match
ClosedPublic

Authored by cullmann on Aug 28 2018, 2:29 PM.

Details

Summary

e.g. doMatch for regex stuff will use -1 as skipOffset.
But -1 was not handled at all and you matched again and again.

Test Plan

make && make test works

with patch:
Totals: 132 passed, 0 failed, 0 skipped, 0 blacklisted, 2552ms

  • Finished testing of TestHighlighterTest *****

without patch:

Totals: 132 passed, 0 failed, 0 skipped, 0 blacklisted, 3250ms

  • Finished testing of TestHighlighterTest *****

perf shows improvements, too, found during some AbsInt internal profiling .P

Diff Detail

Repository
R216 Syntax Highlighting
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
cullmann created this revision.Aug 28 2018, 2:29 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptAug 28 2018, 2:29 PM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
cullmann requested review of this revision.Aug 28 2018, 2:29 PM
vkrause accepted this revision.Aug 28 2018, 3:31 PM

Nice find! And a nice showcase of a contribution we wouldn't have gotten without MIT relicensing I guess :)

This revision is now accepted and ready to land.Aug 28 2018, 3:31 PM

;=)
Yeah, given I can spend now some work-time on profiling things as we start to use the current master for our tools, I hope I can contribute some more things like this.
A colleague has seen a massive slow-down compared to our old highlighter for some internal format and given it just has a few regex rules and a keyword list, this is a bit strange, need to see if this alone solves it.

This revision was automatically updated to reflect the committed changes.