On Oct 5, 2014, at 3:13 PM, Patrick Walton <pcwal...@mozilla.com> wrote:
> On 10/5/14 3:08 PM, Boris Zbarsky wrote: >> On 10/5/14, 2:27 PM, Cameron Zwarich wrote: >>> I am opposed to anything that requires string copies between the DOM >>> and JS >> >> The only way to do that with SpiderMonkey in its current state is to use >> JSString for your string type. You cannot safely grab the chars from a >> SpiderMonkey string and hold that pointer across a GC operation, because >> the GC might move the string data in memory. > > I wonder if copying from UCS-2 to WTF-8 can be made faster than copying from > UCS-2 to UCS-2, due to performing half the number of writes in the common > case (Latin-1)... seems like an interesting experiment! If actual Latin-1 strings (as opposed to Latin-1 characters) are the common case, then a dual Latin-1 / UCS-2 representation will be the fastest. Cameron _______________________________________________ dev-servo mailing list dev-servo@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-servo