Are frozen Objects faster ?

Herby Vojčík herby at
Thu Feb 14 11:56:48 PST 2013

Andreas Rossberg wrote:
> On 14 February 2013 19:26, Herby Vojčík<herby at>  wrote:
>> I meant "de facto". People wanting to remove property bar from foo do not
>> write `delete` anymore; they (at least some significant subset) have
>> learned to write ` = null;` or ` = undefined;`. The reason is
>> perf - `delete` deoptimized hidden classes.
> And with ES6, those people will hopefully realise that for those
> cases, using a Map is a cleaner alternative anyway.

No, it is another scenario. If an object is used as a Map, it should 
degrade to HashMap, it's ok.

The problem is proliferation of ` = null` in "normal" code, where 
sometimes you want to remove some property (maybe it was an expando, or 
it is realy not needed any more in the actual phases of the lifecycle). 
In such cases, doing `delete` would degrade your optimized instance into 
a Hash. Thus, people do ` = null` even if what they want to do is 

> /Andreas


More information about the es-discuss mailing list