Closed Bug 566942 Opened 10 years ago Closed 9 years ago

nsTextFragment::SetTo can be slow

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla5

People

(Reporter: smaug, Assigned: graememcc)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Seems like in some testcases (dromaeo for example), nsTextFragment::SetTo
is very slow. 
Jonas, is there anything we could optimize, or could we just undo Bug 329974?
Blocks: domperf
Perhaps we could limit the whitespace optimizations to small strings?
We definitely should limit to scanning short strings! We can't use static data for strings longer than a certain size anyway.
I'm guessing we would want to collect data from the wild to determine what size of string we want to limit the optimisations to. However, in any case, is this worth taking as a starting point?
Attachment #449111 - Flags: review?(jonas)
Have you profiled the patch with some testcases?
Comment on attachment 449111 [details] [diff] [review]
Don't look for whitespace optimisations beyond the maximum whitespace string size

I did a bunch of profiling when I initially implemented this sharing. See bug 329974.

Of course, the world has likely changed since then so if someone wants to profile again that would be great.
Attachment #449111 - Flags: review?(jonas) → review+
Duplicate of this bug: 77586
Did this ever land?
Jonas?
Checked in. Thanks for the fix! Sorry about taking so long to land it :(

Let me know if you have more time to help out, we've got plenty of things that need patches!

http://hg.mozilla.org/mozilla-central/rev/c2fcc089efae
Assignee: nobody → graememcc_firefox
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.2
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.