SpellChecker::updateMarkersForWordsAffectedByEditing is slow |
|||
Issue descriptionThis function is called both at the beginning and the ending of an editing operation (e.g., typing a character), with super complicated logic. We should make it simple and fast.
,
Mar 25 2017
The issue[1] also implies making Editor independent from spell checker. We should have idle time spelling marker remover along with idle time spell checker. Since idle time spell checker tracks contents modification and it should remove marker on requeted paragraph, we may want to removing marker into it. [1] http://crbug.com/517298 Spell checker should work in idle time rather than every text change
,
Mar 30 2017
I summarized the removal of stale spellcheck markers here: https://docs.google.com/document/d/1RVnBQxwIe_Tfx0bVHrM0bdUeRSJiG2OGuPgsKIO2gOI/edit?usp=sharing Given that: 1. Successful SpellCheckRequest clears all markers in its checking range, and 2. The checking range of a SpellCheckRequest is always aligned to sentence boundaries There is not much need to remove any stale marker if a SpellCheckRequest is issued. There are some corner cases but I don't think they are important. Hence, this issue can be solved in the framework of idle time spell checker: 1. In hot mode checking, for each root editable that was just edited: - If we decide to check the root editable, no need to clear any stale marker - If we decide not to check the root editable because we are typing in the middle of a word, call SpellChecker::updateMarkersForWordsAffectedByEditing to clear marker under the current word - If we decide not to check the root editable for any other reason, still no need to clear any stale marker 2. Baseline correctness: any stale marker not cleared in hot mode will be cleared in cold mode
,
Mar 31 2017
In review: https://codereview.chromium.org/2785103005 Attachments are trace taken after patch. Latency due to spell checking code is almost negligible (75ms out of 2.5s), and the average latency per character input is reduced by half.
,
Apr 5 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/fd7ce52f21f9dd6c741ee0545cc109ed6267b95e commit fd7ce52f21f9dd6c741ee0545cc109ed6267b95e Author: xiaochengh <xiaochengh@chromium.org> Date: Wed Apr 05 03:34:11 2017 Remove stale spellcheck markers at idle time Blink's spellchecker used to remove stale/invalid markers synchronously, which is time-costly. This patch greatly simplifies the removal logic by integrate it with idle time spell checker. Detailed design and analysis: https://goo.gl/P7F710 BUG= 705180 TEST=Existing layout tests under editing/spelling/ Review-Url: https://codereview.chromium.org/2785103005 Cr-Commit-Position: refs/heads/master@{#461968} [modify] https://crrev.com/fd7ce52f21f9dd6c741ee0545cc109ed6267b95e/third_party/WebKit/Source/core/editing/spellcheck/HotModeSpellCheckRequester.cpp [modify] https://crrev.com/fd7ce52f21f9dd6c741ee0545cc109ed6267b95e/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
,
Apr 5 2017
After r461968, stale spellcheck marker removal is no longer an issue as long as idle time spell checking is enabled. Hence marking the issue as fixed. |
|||
►
Sign in to add a comment |
|||
Comment 1 by xiaoche...@chromium.org
, Mar 25 2017162 KB
162 KB View Download
1.7 MB
1.7 MB Download