nsTextFragment::SetTo can be slow

RESOLVED FIXED in mozilla5

Status

()

Core
DOM
RESOLVED FIXED
7 years ago
6 years ago

People

(Reporter: smaug, Assigned: graememcc)

Tracking

(Blocks: 1 bug)

Trunk
mozilla5
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

7 years ago
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?
(Reporter)

Updated

7 years ago
Blocks: 558145
(Reporter)

Comment 1

7 years ago
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.
(Assignee)

Comment 3

7 years ago
Created attachment 449111 [details] [diff] [review]
Don't look for whitespace optimisations beyond the maximum whitespace string size

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)
(Reporter)

Comment 4

7 years ago
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+

Updated

7 years ago
Duplicate of this bug: 77586
(Reporter)

Comment 7

7 years ago
Did this ever land?
(Reporter)

Comment 8

6 years ago
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
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.2
You need to log in before you can comment on or make changes to this bug.