Closed Bug 600301 Opened 15 years ago Closed 15 years ago

Optimize ReplacePrep

Categories

(Core :: XPCOM, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: smaug, Assigned: smaug)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

This should also optimize out some MutatePrep calls. Patch coming soon.
Attached patch v1Splinter Review
This is one way to speed up append/assign. Speeds up GetInnerHTML 5-10% where append is called a lot. I pushed the patch to tryserver.
Attachment #479154 - Flags: review?
Attachment #479154 - Flags: review? → review?(benjamin)
Benjamin, any chance for a review? I'm hoping to get this to FF4 as a part of other optimization patches.
Comment on attachment 479154 [details] [diff] [review] v1 Does ReplacePrep actually get inlined in this case? That seems like a fair bit of code to get inlined...
Attachment #479154 - Flags: review?(benjamin) → review+
ReplacePrep is not used in too many places.
Attachment #479154 - Flags: approval2.0?
Attachment #479154 - Flags: approval2.0? → approval2.0+
How can you be sure that it's safe to mutate the given string in place?
Neil, I don't understand what you mean.
Neil, I tried to keep the behavior of ReplacePrep and MutatePrep. Is there some case I missed?
Comment on attachment 479154 [details] [diff] [review] v1 >+ if (cutStart == mLength && Capacity() > newTotalLen) { OK, so I worked that last one out. But perhaps you could have checked for cutStart + cutLength == mLength, like ReplacePrep does, thus allowing you to remove the check in ReplacePrep?
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Component: String → XPCOM
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: