improve performance of Rule::isWordDelimiter and KeywordListRule::doMatch
ClosedPublic

Authored by cullmann on Aug 28 2018, 4:54 PM.

Details

Test Plan

make && make test

before, perf tells for

perf record -g ./bin/htmlhighlighter_test

> Rule::match 40% & KeywordListRule::doMatch 26%

after the patch

> Rule::match 17% & KeywordListRule::doMatch 4.5%

binary search was slower, contains is much faster on the VERY small strings

Diff Detail

Repository
R216 Syntax Highlighting
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 2310
Build 2328: arc lint + arc unit
cullmann created this revision.Aug 28 2018, 4:54 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptAug 28 2018, 4:54 PM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
cullmann requested review of this revision.Aug 28 2018, 4:54 PM

And yes, you see even the costs for the auto defData = DefinitionData::get(m_def.definition()); as a high percentage, close to the total costs of KeywordListRule::doMatch now.

cullmann updated this revision to Diff 40572.Aug 28 2018, 5:05 PM

optimize html exporter, 23% => 15% of runtime for applyFormat in unit test

cullmann updated this revision to Diff 40573.Aug 28 2018, 5:13 PM

add my copyright, too

vkrause accepted this revision.Aug 28 2018, 5:32 PM

Very nice, thank you!

This revision is now accepted and ready to land.Aug 28 2018, 5:32 PM
This revision was automatically updated to reflect the committed changes.