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
parent
0b384f36
Please register or sign in to comment