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?
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.
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?
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.
Did this ever land?
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