Closed
Bug 74655
Opened 24 years ago
Closed 24 years ago
40% of reply time in mailcompose spent converting linefeeds
Categories
(Core :: DOM: Editor, defect, P2)
Tracking
()
VERIFIED
FIXED
mozilla0.9
People
(Reporter: hyatt, Assigned: mozeditor)
References
Details
40% of reply time on large messages is spent in ReplaceSubstring. The original
caller of this method is in the mailcompose code. It is called TranslateLineBreaks.
This function should first be removed from mail compose, but even after it is
gone, editor does this conversion in nsHTMLDataTransfer. Just grep for the four
occurrences of ReplaceSubstring in the editor code.
This linefeed conversion should be done without performing a replace, since you
end up thrashing in memmove.
Comment 1•24 years ago
|
||
assigning to jfrancis
Severity: normal → major
Priority: -- → P2
Target Milestone: --- → mozilla0.9
Comment 2•24 years ago
|
||
I checked in mozilla/xpcom/io/nsLinebreakConverter.cpp/h a long time ago which
does efficient linebreak conversions on strings (though the nsString version
doesn't work on nsAutoStrings).
It seems that the right thing to do would be to rewrite these to use some of the
new string class goodness, and encourage their use everywhere.
Assignee: beppe → jfrancis
Comment 3•24 years ago
|
||
Places that do inefficient linebreak conversions:
/editor/base/nsHTMLEditor.cpp, line 918 --
inputString.ReplaceSubstring(NS_ConvertASCIItoUCS2("\r\n"),
/editor/base/nsHTMLDataTransfer.cpp, line 199 --
inputString.ReplaceSubstring(NS_ConvertASCIItoUCS2("\r\n"),
/htmlparser/src/nsViewSourceHTML.cpp, line 1185 --
theStr.ReplaceSubstring(NS_ConvertASCIItoUCS2("\r\n"), NS_ConvertASCIItoUCS2("\
n"));
/layout/html/forms/src/nsFormControlHelper.cpp, line 122 --
aString.ReplaceSubstring(NS_ConvertASCIItoUCS2("\r\n"),
NS_ConvertASCIItoUCS2("\n"));
/mailnews/compose/src/nsMsgCompUtils.cpp, line 2069 --
aInString.ReplaceSubstring(NS_ConvertASCIItoUCS2(CRLF),
NS_ConvertASCIItoUCS2(LF));
Assignee | ||
Comment 4•24 years ago
|
||
simon: do your converters work with the new string api's?
hyatt: I beelieve i can avoid this whole issue in the work I'm doing now. I have
to go thrugh the string a character at a time anyway to do whitespace conversion.
I can look for crlf's etc on the way and treat them all as needed.
Comment 5•24 years ago
|
||
Joe: no. Nor do they work with nsAutoStrings.
Assignee | ||
Comment 7•24 years ago
|
||
fix checked in
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•