> > Are UTF8-backed (as opposed to Latin1-backed) JS strings with random access
> > going to be a real possibility in SpiderMonkey? It’s obviously possible to
> > make random access work with an appropriate indexing data structure, but
> > popular JS benchmarks are pretty sensitive to string performance.
> 
> Jan de Mooij (a.k.a. jandem) is implementing them. My understanding is
> that he considered utf8 as well, and concluded that latin1 would be
> simpler and give the same performance benefits. But he also said that
> if utf8 is needed in the future, the latin1 work should pave the way
> substantially.

Also, there was a bit of a chicken-and-egg problem: to benefit from utf8 (over 
just latin1), we'd need to convert Gecko to actually preserve utf8 and feed it 
in to SM.  Gecko has been optimized around a two-byte-char JSAPI for decades, 
so it seemed like this conversion would take significant effort.  With latin1, 
we're able to get immediate and significant wins (bug 998392) without the perf 
hazards of utf8.  And, as you said, we are now in a much better place to add 
utf8 in the future.
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo

Reply via email to