Re: [dev-servo] meeting notes (UTF8)

2014-07-08 Thread Luke Wagner
> > 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


Re: [dev-servo] meeting notes (UTF8)

2014-07-07 Thread Robert O'Callahan
On Tue, Jul 8, 2014 at 2:51 PM, Cameron Zwarich  wrote:

> 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.
>

If Spidermonkey supported both UTF8 and UTF16, it could probably just
convert to UTF16 on the first charAt etc. I hope that would be good enough
for SS-crypto.

Rob
-- 
oIo otoeololo oyooouo otohoaoto oaonoyooonoeo owohooo oioso oaonogoroyo
owoiotoho oao oboroootohoeoro oooro osoiosotoeoro owoiololo oboeo
osouobojoeocoto otooo ojouodogomoeonoto.o oAogoaoiono,o oaonoyooonoeo
owohooo
osoaoyoso otooo oao oboroootohoeoro oooro osoiosotoeoro,o o‘oRoaocoao,o’o
oioso
oaonosowoeoroaoboloeo otooo otohoeo ocooouoroto.o oAonodo oaonoyooonoeo
owohooo
osoaoyoso,o o‘oYooouo ofolo!o’o owoiololo oboeo oiono odoaonogoeoro
ooofo
otohoeo ofoioroeo ooofo ohoeololo.
___
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo


Re: [dev-servo] meeting notes (UTF8)

2014-07-07 Thread Nicholas Nethercote
On Mon, Jul 7, 2014 at 7:51 PM, Cameron Zwarich  wrote:
> 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.

So I wouldn't count on utf8 soon, but it might happen at some point.

Nick
___
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo


Re: [dev-servo] meeting notes (UTF8)

2014-07-07 Thread Cameron Zwarich
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.

Cameron

On Jul 7, 2014, at 7:01 PM, Robert O'Callahan  wrote:

> I'm excited about pushing UTF8 as far as possible!
> 
> One thing not mentioned in the notes is that Spidermonkey is adding Latin-1
> string support, so hopefully it will be pretty easy to avoid converting
> ASCII-only strings at WebIDL boundaries. It would certainly be ideal if
> Spidermonkey eventually supports UTF8 directly.
> 
> If you want to, it's easy enough to encode lone surrogates in UTF8. Just
> encode the UTF-16 code point as if it was a real character.
> 
> Rob
___
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo


Re: [dev-servo] meeting notes (UTF8)

2014-07-07 Thread Boris Zbarsky

On 7/7/14, 10:01 PM, Robert O'Callahan wrote:

One thing not mentioned in the notes is that Spidermonkey is adding Latin-1
string support, so hopefully it will be pretty easy to avoid converting
ASCII-only strings at WebIDL boundaries.


Note that they also are adding GC-unstable string chars, so the only way 
to avoid copying at the boundary will be to not ask for the chars until 
you really need them, and then to not GC until you're done using them.


-Boris
___
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo