Closed
Bug 74904
Opened 24 years ago
Closed 24 years ago
ReplaceSubstring is O(n^2) (SLOW SLOW SLOW)
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
mozilla0.9.2
People
(Reporter: hyatt, Assigned: scc)
References
Details
(Keywords: perf)
The ReplaceSubstring implementation is O(n^2), when it should be O(n). 40% of
mailnews reply performance on large messages is in this method.
Keywords: perf
Assignee | ||
Comment 1•24 years ago
|
||
|ns[C]String::ReplaceSubstring| doesn't even work in all cases; rickg left a
warning there
//WARNING: This is not working yet!!!!!
I was just about to provide a new implementation that works on all strings, not
just |ns[C]String|s. See bug #74896.
Blocks: 70090
Status: NEW → ASSIGNED
Component: Browser-General → String
OS: other → All
Hardware: PC → All
Target Milestone: --- → mozilla0.9
Assignee | ||
Updated•24 years ago
|
Assignee | ||
Comment 2•24 years ago
|
||
These are the 0.9 bugs that didn't make it, and that I intend to fix in 0.9.1
Target Milestone: mozilla0.9 → mozilla0.9.1
Assignee | ||
Comment 3•24 years ago
|
||
re-targeting milestones, starting from a clean slate
Target Milestone: mozilla0.9.1 → ---
Assignee | ||
Comment 4•24 years ago
|
||
marking the functionality blockers for immediate attention in mozilla0.9.1
Target Milestone: --- → mozilla0.9.1
Assignee | ||
Comment 5•24 years ago
|
||
What is being replaced in the mail/news case? If |ReplaceSubstring| is being
used for CRLF conversion, then a more specific solution may be appropriate. David?
Comment 6•24 years ago
|
||
If you're going to work on ReplaceSubstring(), how about moving the real
implementation into a global function that works on an nsAWritableString, and
then re-implement the ns[C]String::ReplaceSubstring() method in terms of that?
(That's probably already your plan, but I thought I'd make it explicit.)
There are some places in my own code where I could use this.
Comment 7•24 years ago
|
||
let's land this in 0.9.2. let drivers know if this creates problems. thanks.
Target Milestone: mozilla0.9.1 → mozilla0.9.2
Assignee | ||
Comment 8•24 years ago
|
||
The fix to this bug is that we're going to replace the entire implementation of
|ReplaceSubstring| with the new |nsSubstituteC?String| generator. See bug
#82456. There's no perfect way to mark this bug for this resolution (it's not
FIXED yet, it's not INVALID, it's not WONTFIX). We'll settle for making it a
dup of the new bug.
*** This bug has been marked as a duplicate of 82456 ***
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
Updated•4 years ago
|
Component: String → XPCOM
You need to log in
before you can comment on or make changes to this bug.
Description
•