Closed Bug 35292 Opened 26 years ago Closed 25 years ago

PERF: nsHTMLEditor::Paste() needs improvement

Categories

(Core :: DOM: Editor, defect, P3)

defect

Tracking

()

VERIFIED FIXED
mozilla0.8

People

(Reporter: mozeditor, Assigned: mozeditor)

References

Details

(Keywords: perf, Whiteboard: nsbeta3-)

The portion of Paste that is before the actual call to InsertText() takes too long. Almost as long as the InsertText call itself. This hurts us for large pastes.
Blocks: 28783
Joe, can you give any more information here? I'm assuming this is plaintext, since you mention InsertText. The only things that happen in nsHTMLEditor::Paste before the InsertText call are whatever magic happens with ForceCompositionEnd(), and actually getting the data from the clipboard/transferable. Is there inefficiency happening in the clipboard for large pastes?
moving this over to m17 folks -- where other perf work is slotted.
Target Milestone: --- → M17
Joe showed me the calls that were taking the time, and they're all clipboard calls (negotiating the flavor with the transferable), so it looks like this is Pink's area. Probably covered under the stuff he was already planning to restructure ...
Assignee: akkana → pinkerton
can you put that information in here so I have something to go on? thanks.
Status: NEW → ASSIGNED
Target Milestone: M17 → M18
mass-moving all bugs to m21 that are not dofood+, or nsbeta2+
Target Milestone: M18 → M21
Adding perf keyword
Keywords: perf
i'll profile the clipboard side of things and see if i can find anything.
Keywords: nsbeta3
Don't think this is on the short list of perf issues we need to fix for NS6, -> future
Target Milestone: M21 → Future
Whiteboard: nsbeta3-
Blocks: 53252
No longer blocks: 28783
Target Milestone: Future → mozilla1.0
ok, 0.8 for the 3rd time
Target Milestone: mozilla1.0 → mozilla0.8
i profiled this, and it isn't any clipboard code. the bulk of the time pasting both plain text and html is in InsertText and InsertHTMLWithContext. There is also some time taken by the extra copying of data to put it into an nsString for passing to the Insert* calls. I would suggest rewriting these api's to not take nsStrings and thus avoid copying data to get them into a string solely for the sake of the API. The clipboard portion of the process is negligable and barely shows up on the profile. back to an editor person.
Assignee: pinkerton → akkana
Status: ASSIGNED → NEW
The performance issue with inserting text (rewriting whitespace, etc.) is Joe's. Though I'd be happy to rewrite the API and eliminate the string copies: in fact, I expect that will happen anyway as we migrate our APIs to XPIDL.
Assignee: akkana → jfrancis
ok, then something has changed (which doesn't surprise me, since the intrumentation that led to this bug happened long long ago). Closing this out based on pinks comment that clipboard no longer taking time.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
verified in 1/24 build.
Status: RESOLVED → VERIFIED
Blocks: 28783
You need to log in before you can comment on or make changes to this bug.