Initialize properties to avoid hidden class thrashing.#1752
Initialize properties to avoid hidden class thrashing.#1752sebmck merged 1 commit intobabel:masterfrom
Conversation
There was a problem hiding this comment.
i would like to recommend undefiend over `null.
undefined: no value
null: not a value
but both shape the object correctly.
This allows for obj.key === undefined checks for fast property checks, without needing a sentinel.
There was a problem hiding this comment.
I agree with Stefan, undefined is probably better choice.
There was a problem hiding this comment.
@bmeurer does it have better perf than initializing as null and comparing against null later? or are you suggesting this because of the mentioned different semantics (no value / not a value)
There was a problem hiding this comment.
There's probably no performance difference, but I think it's easier to maintain long-term if you keep the invariant that undefined stands for no value as @stefanpenner pointed out above.
Initialize properties to avoid hidden class thrashing.
|
@stefanpenner Probably doesn't matter too much. Not sure if there's many places were that would come in handy. |
I think this is all the properties for
NodePath?On my machine, building ember goes down 10-15%ish.