Fix bad performance for `addRules` in `DefaultHighlighter` for big containers

Authored by sirgienko on Apr 8 2018, 2:31 PM.

Description

Fix bad performance for addRules in DefaultHighlighter for big containers

Summary: Now, in addRules we call addRule, which emit rulesChanged, that leads to rehighlight all worksheet. This is useless work, because for each rule in rules container we reprocessing all worksheet. (instead better option to emit rulesChanged only one time after container processing). So, when container is big, performance falls quite strongly, for example highlighter of octave backend spends 2-4 seconds for adding new function. So this changes improve emit logic, calling only one event for rules container.

Test Plan:

  1. Start octave backend, write octave function, check, that cantor is freezed for few seconds
  2. Apply patch
  3. Check, that octave backend don't freeze after entry with user function.

Reviewers: Cantor, asemke

Subscribers: Cantor, KDE Edu

Tags: KDE Edu, Cantor

Differential Revision: https://phabricator.kde.org/D11992