Spell checker causes high cpu in this testcase

RESOLVED WONTFIX

Status

()

RESOLVED WONTFIX
13 years ago
13 years ago

People

(Reporter: martijn.martijn, Assigned: mscott)

Tracking

({perf, testcase})

Trunk
x86
Windows XP
perf, testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

13 years ago
See upcoming testcase, which is much slower when the spell checker is on for the textarea.

The testcase updates the textarea.value every 50ms, and in this case it seems as if all the words in the textarea are re-spell checked.
It seems there could be some optimisation here, since most of the text doesn't change.

Forums also use this kind of code to add bb-tags or smiley code, for example, so this isn't entirely a theoretical situation (although the slowness is probably not noticed, because you typically only press once to add a smiley/bb-tag).
(Reporter)

Comment 1

13 years ago
Created attachment 232542 [details]
testcase

Comment 2

13 years ago
When you set the value, the value is replaced. The text is totally new, we have new DOMNodes, new frames, new everything.

The current spellcheck misspellings are DOM ranges that refer to old DOMNodes and old positions. When you replace the text, all of these go away. We MUST re-spellcheck the entire document or there will be no misspellings marked.

The only possible optimization here would be on value setting, where it could notice that the new value is actually the old value plus something else, and append new text instead. I'm not sure what the ramifications of this would be, and I would argue that it's probably not worth it. If you disagree, you can refile under the DOM component or something.
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.