How confident can we be that this will actually be a performance
improvement? CSSStyleRule, which has been given a new styleMap
attribute, is already a wrapper around a compat internal
representation, so I presume that every new interface introduced by
CSS Typed OM will similarly be wrappers? If so, it seems like
interacting with this API would have to create a lot of new objects
with hooks to keep them in sync with the internal representation. At
first glance, it doesn't seem like a given that this would be faster
than string parsing, and at the very least it ought to use more
memory.
Implementing may of course help answer questions like these, but I'm
curious to know if I'm being too pessimistic.
On Wed, Oct 21, 2015 at 8:06 AM, Philip Jägenstedt <phi...@opera.com> wrote:How confident can we be that this will actually be a performance
improvement? CSSStyleRule, which has been given a new styleMap
attribute, is already a wrapper around a compat internal
representation, so I presume that every new interface introduced by
CSS Typed OM will similarly be wrappers? If so, it seems like
interacting with this API would have to create a lot of new objects
with hooks to keep them in sync with the internal representation.
At
first glance, it doesn't seem like a given that this would be faster
than string parsing, and at the very least it ought to use more
memory.
Implementing may of course help answer questions like these, but I'm
curious to know if I'm being too pessimistic.The plan, as I understood it, was definitely to have a fast implementation that avoided conversion back and forth between strings. Not sure if we have any data yet on what to expect. It's probably a good idea to do some microbenchmarks early in the implementation to get some concrete data. Eddy / Shane, do you have any particular target scenario to focus measurements on? Eg. what's the string parsing overhead of common scenarios like animating the position of a bunch of elements by changing their style.transform?
On Wed, Oct 21, 2015 at 9:29 AM Rick Byers <rby...@chromium.org> wrote:On Wed, Oct 21, 2015 at 8:06 AM, Philip Jägenstedt <phi...@opera.com> wrote:How confident can we be that this will actually be a performance
improvement? CSSStyleRule, which has been given a new styleMap
attribute, is already a wrapper around a compat internal
representation, so I presume that every new interface introduced by
CSS Typed OM will similarly be wrappers? If so, it seems likeinteracting with this API would have to create a lot of new objects
with hooks to keep them in sync with the internal representation.The design is that the things exposed are copies (not the styleMap itself, but the things you query out of the styleMap). So they are not live (i.e. not kept in sync with the internal representation). This was done specifically for the performance/memory/complexity reasons you cite.