Are frozen Objects faster ?

Andrea Giammarchi andrea.giammarchi at gmail.com
Thu Feb 14 12:50:27 PST 2013


I wodner how come Firefox behaves like that then but I don't have tests to
compare any difference between these two. I will write some, thanks


On Thu, Feb 14, 2013 at 12:48 PM, Andreas Rossberg <rossberg at google.com>wrote:

> On 14 February 2013 21:36, Andrea Giammarchi
> <andrea.giammarchi at gmail.com> wrote:
> > "Binary Arrays" are indeed frozen objects, at least in Firefox, and ultra
> > fast:
> > Object.isFrozen(new Float32Array()) // true in Firefox
> >
> > Since these are ultra fast in Chrome too but not frozen, I believe there
> is
> > already a way to speed up typed stuff (didn't check how it's done
> though) so
> > I wonder how come Object.freeze() is not taking similar approach
> "typizing"
> > behind the scene the object improving all static properties getters
> > (probably dropping those getters where possible unless defined as such)
>
> Frozenness is largely irrelevant for typed arrays, since all array
> accesses are defined by a magic nameless getter/setter pair per the
> WebIDL spec.
>
> /Andreas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130214/35456d2e/attachment.html>


More information about the es-discuss mailing list