Closed
Bug 596501
Opened 14 years ago
Closed 7 years ago
Make TextEditor::OutputToString faster
Categories
(Core :: DOM: Editor, defect)
Tracking
()
RESOLVED
FIXED
mozilla56
Tracking | Status | |
---|---|---|
firefox56 | --- | fixed |
People
(Reporter: bzbarsky, Assigned: masayuki)
References
(Blocks 1 open bug)
Details
(Keywords: perf, Whiteboard: [post-2.0])
Attachments
(1 file)
For the typical case (not password input, not wrap="hard" textarea, etc), we should be able to just hand back the string inside our one textnode, I would think.
Reporter | ||
Comment 1•14 years ago
|
||
Ehsan, do you have time to take a look at this?
Comment 2•14 years ago
|
||
I'm not sure I understand what you're proposing here. Isn't that what we already do, through nsDocumentEncoder?
Reporter | ||
Comment 3•14 years ago
|
||
Yes, with giant amounts of overhead. I'm proposing we skip the overhead.
Comment 4•14 years ago
|
||
(In reply to comment #3) > Yes, with giant amounts of overhead. I'm proposing we skip the overhead. Do you have a profile on what takes too much time in this process?
Reporter | ||
Comment 5•14 years ago
|
||
Sure thing. On the testcase in bug 190147, the time under OutputToString breaks down as follows (all percentages are of time under OutputToString; "in" means in the function, "under" means in the function or some function it calls): 4% setting up the document encoder, QIs, etc getting to call nsPlainTextSerializer::AppendText. 3% FindCharInset called from Appendtext 3% nsDependentSubstring::Rebind called from AppendText 2% nsString::AssignWithConversion called from AppendText 2% in AppendText itself 4% in nsPlainTextSerializer::DoAddLeaf. 48% under nsPlainTextSerializer::EndLine (calling Replace, calling SetLength, calling OutputQuotesAndIndent, etc) (why are the Replace and SetLength calls happening at all?) 4% in nsPlainTextSerializer::Write 3% FindCharInSet called from Write() 7% nsAString::Assign called from Write() 19% under nsPlaintextSerializer::AddToLine; almost all of this is calling Replace(); again not sure why we need this.
Comment 7•14 years ago
|
||
I'm probably going to take a look at this post Firefox 4, so if someone else wants to steal it from me before then, I won't call the cops! ;-)
Reporter | ||
Comment 8•14 years ago
|
||
It'd still be nice to understand why those Replace and so forth happen, btw... and especially why they actually resize the strings!
Updated•13 years ago
|
Whiteboard: [post-2.0]
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → masayuki
Status: NEW → ASSIGNED
Assignee | ||
Comment 10•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=6ecbc3b280b47750ed80f36a2d642a9e8d96882f
Assignee | ||
Comment 11•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=af8136e4fa88392fba6f02f44231c65437857fbf
Assignee | ||
Updated•7 years ago
|
Summary: Make nsPlaintextEditor::OutputToString faster → Make TextEditor::OutputToString faster
Assignee | ||
Comment 12•7 years ago
|
||
I guess that this performance issue is not so appear in profiles dynamically. However, this is used by autocomplete at every type, caching the value in nsTextEditorState and caching change event when moving focus to editor. So, some users could feel like this bug as "Firefox responds not so quickly at typing something". I'm not sure how to detect such similar issues.
Comment hidden (mozreview-request) |
Assignee | ||
Comment 14•7 years ago
|
||
The patch improves the score of attachment 8848015 [details] about 10%.
Comment 15•7 years ago
|
||
mozreview-review |
Comment on attachment 8879213 [details] Bug 596501 TextEditRules::WillOutputText() should handle itself if it can return only the text of first text node https://reviewboard.mozilla.org/r/150536/#review155446
Attachment #8879213 -
Flags: review?(m_kato) → review+
Comment 16•7 years ago
|
||
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/36a05246c18c TextEditRules::WillOutputText() should handle itself if it can return only the text of first text node r=m_kato
Comment 17•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/36a05246c18c
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox56:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in
before you can comment on or make changes to this bug.
Description
•