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

Christoph Cullmann noreply at phabricator.kde.org
Tue Aug 28 17:54:45 BST 2018


cullmann created this revision.
cullmann added reviewers: vkrause, dhaumann.
Herald added projects: Kate, Frameworks.
Herald added subscribers: kde-frameworks-devel, kwrite-devel.
cullmann requested review of this revision.

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

REPOSITORY
  R216 Syntax Highlighting

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D15129

AFFECTED FILES
  src/lib/rule.cpp
  src/lib/rule_p.h

To: cullmann, vkrause, dhaumann
Cc: kwrite-devel, kde-frameworks-devel, michaelh, kevinapavew, ngraham, bruns, demsking, cullmann, sars, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20180828/3dfe6699/attachment.html>


More information about the KWrite-Devel mailing list