Closed
Bug 312681
Opened 19 years ago
Closed 19 years ago
optimized nsTSubstring Replace/Assign for single-character replacement
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
People
(Reporter: bryner, Assigned: bryner)
References
Details
(Keywords: perf)
Attachments
(1 file)
2.77 KB,
patch
|
darin.moz
:
review+
darin.moz
:
superreview+
|
Details | Diff | Splinter Review |
Obviously building up a string a character at a time is often not the most
efficient way to do it, but we penalize it even more by using memcpy() for
this case. I did some quick testing on Windows (with a small test app) and
found that just using pointer assignment is significantly faster (maybe 50%)
than calling memcpy for repeated single-character copying.
Assignee | ||
Comment 1•19 years ago
|
||
Attachment #199776 -
Flags: superreview?(darin)
Attachment #199776 -
Flags: review?(darin)
Comment 2•19 years ago
|
||
Comment on attachment 199776 [details] [diff] [review]
patch
"mData[cutStart] = c" reads a bit better IMO.
r+sr=darin
Attachment #199776 -
Flags: superreview?(darin)
Attachment #199776 -
Flags: superreview+
Attachment #199776 -
Flags: review?(darin)
Attachment #199776 -
Flags: review+
Assignee | ||
Comment 3•19 years ago
|
||
checked in
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Comment 4•19 years ago
|
||
*** Bug 311458 has been marked as a duplicate of this bug. ***
Updated•4 years ago
|
Component: String → XPCOM
You need to log in
before you can comment on or make changes to this bug.
Description
•