Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(Subscription): use
instanceof
to avoid megamorphic LoadIC
In `Subscription#add()` use `instanceof` to test whether `subscription` must be wrapped in a `Subscription` (aka for presence of `_addParent` method), instead of `typeof subscription._addParent === 'function'`, as the latter is going to turn into a *megamorphic property access* in any realistic application and cause quite a bit of contention on the megamorphic stub cache in Node (aka V8). The `instanceof` is definitely faster, even if the property access would hit the megamorphic stub cache.
- Loading branch information