Open Bug 585621 Opened 14 years ago Updated 7 months ago

Stop doing 1-byte detection for the text passed to createTextNode

Categories

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

x86
macOS
defect

Tracking

()

People

(Reporter: bzbarsky, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

This is meant to be a memory and layout-time optimization, but it hurts us on DOM benchmarks, and it's not common to have large amounts of text passed to createTextNode and then rendered, which is when the optimization would perhaps matter.

We should just assume that text passed to createTextNode should be stored as 2-byte text.
So, what's the scope of this bug?  nsDocument::CreateTextNode just calls NS_NewTextNode and then calls SetText on it.  Is this going to be similar to bug 582858?
> So, what's the scope of this bug?

Storing the text passed to createTextNode as UTF-16.  Nothing else.

> Is this going to be similar to bug 582858?

That bug subsumes this one, but not vice versa, clearly.

I ran the numbers; our current score on dromaeo's createTextNode is 80.  With this patch it goes up to 100.  Safari is at 280 or so, but it doesn't do any string copying at all during this operation (well past perhaps flattening their js string), unlike us.
Attachment #464097 - Flags: review?(jst)
And clearly, if we decide to do bug 582858 we don't need this.
Comment on attachment 464097 [details] [diff] [review]
Patch that I was testing

I assume this doesn't handle bidi properly.
Comment on attachment 464097 [details] [diff] [review]
Patch that I was testing

Ah, indeed.  We should just make the bidi stuff a tristate and call SetBidiStatus in BindToTree if we want to make that work, imo.
Attachment #464097 - Flags: review?(jst) → review-
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: