Description
It seems that new EmptyObject
was added as a work-around for Object.create(null)
performance. This has a couple of drawbacks for Ember itself, but also comes with a performance penalty in recent Chrome versions (i.e. in all current channels) that include this CL.
From what I can tell, new EmptyObject
is often used to create objects that are supposed to be used as dictionaries. But at least in V8 function constructors always create fast mode objects, which means Ember probably wastes (metadata) memory in the browser plus time just to let the engine figure out that it should essentially transition these objects to dictionary mode objects. Object.create(null)
always creates a dictionary mode object from the start (since the aforementioned CL landed), and it's compatible with jQuery.isPlainObject
and other stuff. The allocation is roughly on par with the performance of new EmptyObject
in all current Chrome channels.
So I'd like to trigger a discussion to get rid of EmptyObject
.