-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(SafeSubscriber): avoid using
Object.create
In profiling sessions, the `SafeSubscriber` constructor was showing as hot function for code that creates and tear downs Observables very frequently. The usage of `Object.create` attributes to the slowness; avoiding using it completely removes any overhead of `SafeSubscriber`. The `Object.create` result was used to call anonymous subscribers in their own context, i.e. the `this` pointer in `next`/`error`/`complete` is the anonymous object itself. This commit implements an alternative to achieve the same effect; binding the subscriber functions to the observer object.
- Loading branch information
Showing
1 changed file
with
6 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters