Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazy transcoding of DOM strings #1880

Closed
kmcallister opened this issue Mar 10, 2014 · 8 comments
Closed

Lazy transcoding of DOM strings #1880

kmcallister opened this issue Mar 10, 2014 · 8 comments

Comments

@kmcallister
Copy link
Contributor

@kmcallister kmcallister commented Mar 10, 2014

DOM APIs and SpiderMonkey require us to use UCS-2 strings, but the vast majority of content comes off the wire in UTF-8 or another ASCII-compatible encoding. We can save memory and potentially time by storing a DOM string as UTF-8 and converting it to UCS-2 when first touched by script.

Not sure how this would interact with interning.

See #282, #1701.

@SimonSapin
Copy link
Member

@SimonSapin SimonSapin commented Mar 10, 2014

Perhaps we’ll want different strategies for different types of strings: content of a text node, element name, attribute name, attribute value, …

@SimonSapin
Copy link
Member

@SimonSapin SimonSapin commented Mar 10, 2014

This may impact #1879 in the choice of the encoding for the input to the HTML tokenizer.

@kmcallister
Copy link
Contributor Author

@kmcallister kmcallister commented Mar 10, 2014

Yep, that's why I'm thinking about it right now :) Will send an email regarding this today.

@jdm
Copy link
Member

@jdm jdm commented Mar 11, 2014

Dropping a link to Ms2ger's UCS-2 string experiments: Ms2ger/servo@mozilla:master...Ms2ger:strings

@Ms2ger
Copy link
Contributor

@Ms2ger Ms2ger commented Mar 11, 2014

@kmcallister
Copy link
Contributor Author

@kmcallister kmcallister commented Mar 25, 2015

@pshaughn
Copy link
Member

@pshaughn pshaughn commented Jan 24, 2020

Is this issue talking about something that's still relevant, or is it all stuff that was later decided to just make UTF8 all the time?

@jdm
Copy link
Member

@jdm jdm commented Jan 24, 2020

Given that spidermonkey is adding more and more APIs that accept UTF-8, I think we can close this.

@jdm jdm closed this Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.