Re: [dev-servo] WTF-8 encoding for DOM strings and HTML parsing
On Oct 8, 2014, at 10:48 PM, Robert O'Callahan rob...@ocallahan.org wrote: On Tue, Oct 7, 2014 at 6:57 AM, Henri Sivonen hsivo...@hsivonen.fi wrote: On Mon, Oct 6, 2014 at 8:27 PM, Cameron Zwarich zwar...@mozilla.com wrote: So you’re suggesting Servo could get away with UTF-8 in the DOM? I hadn’t considered it. I remove my proposal at the start of this thread, I’d like us to try this instead. UTF-8 strings will mean that we will have to copy all non-7-bit ASCII strings between the DOM and JS. Not if JS stores strings as WTF-8. I think it would be tragic not to bother to try to make the JS engine use WTF-8 when having the opportunity to fix things and thereby miss the opportunity to use UTF-8 in the DOM in Servo. UTF-16 is such a mistake. I agree. There's an opportunity here to improve speed and memory usage while simplifying the overall engine design by having the whole engine use *TF-8 except for JS. We believe we can fix JS performance with a bounded amount of work, and we don't even have to do that work up-front since copying strings between JS and DOM is a viable solution for now. I would be in favor of using UTF-8 in the DOM in Servo if SpiderMonkey would be willing to accept the maintenance burden of having a UTF-8 (WTF-8?) code path that is not used by Gecko. This doesn’t mean that they would have to implement it, just that if an implementation was produced they would be okay with maintaining it. I don’t think it would be good to choose UTF-8 in the DOM in Servo if SpiderMonkey is realistically never going to support it without copies. Cameron ___ dev-servo mailing list dev-servo@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-servo
Re: [dev-servo] WTF-8 encoding for DOM strings and HTML parsing
On Thu, Oct 9, 2014 at 9:21 PM, Henri Sivonen hsivo...@hsivonen.fi wrote: On Wed, Oct 8, 2014 at 4:13 PM, Jan de Mooij jandemo...@gmail.com wrote: Has SpiderMonkey ever been instrumented to find out if most strings are even just ASCII? There are some measurements in https://blog.mozilla.org/javascript/2014/07/21/slimmer-and-faster-javascript-strings-in-firefox/. But even better, you can visit about:memory and see for yourself. Look for entries like this: │ ├──26.43 MB (08.36%) -- strings │ │ ├──13.98 MB (04.43%) -- malloc-heap │ │ │ ├──10.84 MB (03.43%) ── latin1 │ │ │ └───3.14 MB (00.99%) ── two-byte │ │ └──12.45 MB (03.94%) -- gc-heap │ │ ├───9.05 MB (02.86%) ── latin1 │ │ └───3.40 MB (01.08%) ── two-byte You can see these stats on a per-zone basis in the explicit tree, or for the entire main runtime under the js-main-runtime tree. gc-heap refers to the JSString objects store on the GC heap, some of which hold the entire string's chars. malloc-heap refers to separately-stored chars for longer strings. Nick ___ dev-servo mailing list dev-servo@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-servo
Re: [dev-servo] The current scrolling model
On Wed, Oct 8, 2014 at 10:55 PM, Patrick Walton pcwal...@mozilla.com wrote: On 10/8/14 10:51 PM, Robert O'Callahan wrote: You can get away with that for position:fixed, but I don't think you can get away with that for overflow:auto/scroll. We find in Gecko many real situations where scrolled content for a given scrollable container has to be split into multiple layers because content from the container is interspersed in z-order with content that's not scrolling. Samples of such content would be really interesting to take a look at and make sure we handle. In general our approach is functionally identical to WebKit's, so I suspect that whatever WebKit does we can just copy. FirefoxOS Marketplace was one example. I don't have a simple example on hand but I can make up one if you need one. 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