Closed Bug 345050 Opened 18 years ago Closed 18 years ago

Turning off spellchecking is very slow when there are many misspellings.

Categories

(Core :: Spelling checker, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.8.1beta2

People

(Reporter: brettw, Assigned: brettw)

References

Details

(Keywords: fixed1.8.1, perf)

Attachments

(1 file)

For example, go here: http://en.wikipedia.org/w/index.php?title=Jimi_Hendrix&action=edit Without the patch on bug 344895, it might take many minutes to see. Then turn off spellchecking with the context menu for the textarea. It takes a noticeable amount of time. The problem is in RemoveAllRanges() on the spellcheck selection. It iterates over all ranges and calls nsTypedSelection::selectFrames for each of them. This function is pretty scary, and is likely the cause of the slowness.
This bug also causes slowness in "Add to dictionary" for large textareas. See 345059.
OS: Linux → All
Hardware: PC → All
Version: 1.8 Branch → Trunk
Attached file Profile
Overall: Total hit count: 100899 100679 of them under nsTypedSelection::selectFrames, almost all of it under nsTextFrame::SetSelected. Almost all the time under SetSelected is under nsFrameSelection::LookUpSelection. This is called to find the details to delete, if any, as far as I can tell. The problem is that it iterates over all ranges and for each one checks whether our text frame's range intersects it. So the net result is that RemoveAllRanges() on the selection is O(N^2) in the number of ranges. Since we have a _lot_ of ranges here, things are really slow. There's got to be a better way to do this from the selection's point of view, since it _knows_ all the ranges are being removed... If someone more familiar with this details stuff would look at this, that would be great.
Flags: blocking1.9a2?
Flags: blocking1.8.1?
Keywords: perf
Depends on: 345101
Flags: blocking1.8.1? → blocking1.8.1+
Target Milestone: --- → mozilla1.8.1beta2
Assignee: mscott → brettw
Whiteboard: fixed by 345099 which has patch
Fixed by bug 345099.
Status: NEW → RESOLVED
Closed: 18 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
Whiteboard: fixed by 345099 which has patch
Flags: blocking1.9a2?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: