On Oct 6, 2014, at 2:49 PM, Boris Zbarsky <bzbar...@mit.edu> wrote: > On 10/6/14, 10:27 AM, Cameron Zwarich wrote: >> This is an increase in memory usage over all existing engines > > Is it an increase over Gecko?
If Servo used UTF-8 strings in the DOM, then it wouldn’t be able to use JS_NewExternalString in the places where Gecko is able to use it. It would be able to use a future Latin1 variant of JS_NewExternalString, but only for 7-bit ASCII strings. It would still be able to use the generously large ‘small’ inline / fat inline strings. > Are we trying to optimize for performance or memory usage here, or both at > once? My gut feeling would be to optimize for memory usage, but without increasing the complexity of any standard string operations (ruling out something like Lempel-Ziv compression of all strings). Is there any particular place where you feel there is tension between the goals of memory usage and performance? One annoying problem that comes up with using UTF-8 in Servo and UTF-16 / Latin1 in SpiderMonkey is that repeated accesses of a DOM property would cause repeated copying of the same string, so you would need to cache the copies to ensure that JS programs have the expected time / space complexity. Cameron _______________________________________________ dev-servo mailing list dev-servo@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-servo