Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(exhaustMap): remove tryCatch/errorObject (~10% improvement) #1281

Merged
merged 1 commit into from
Feb 2, 2016

Conversation

luisgabriel
Copy link
Contributor

Before:

                       |     RxJS 4.0.7 | RxJS 5.0.0-beta.1 | factor | % improved
----------------------------------------------------------------------------------
exhaustMap - immediate | 1,449 (±0.95%) |   17,023 (±0.88%) | 11.75x |   1,075.1%
            exhaustMap | 4,732 (±0.34%) |   80,795 (±0.38%) | 17.07x |   1,607.4%

After:

                       |     RxJS 4.0.7 | RxJS 5.0.0-beta.1 | factor | % improved
----------------------------------------------------------------------------------
exhaustMap - immediate | 1,452 (±1.14%) |   18,523 (±0.68%) | 12.76x |   1,175.5%
            exhaustMap | 4,941 (±0.29%) |   87,146 (±0.39%) | 17.64x |   1,663.8%

Before:
                       |     RxJS 4.0.7 | RxJS 5.0.0-beta.1 | factor | % improved
----------------------------------------------------------------------------------
exhaustMap - immediate | 1,449 (±0.95%) |   17,023 (±0.88%) | 11.75x |   1,075.1%
            exhaustMap | 4,732 (±0.34%) |   80,795 (±0.38%) | 17.07x |   1,607.4%

After:
                       |     RxJS 4.0.7 | RxJS 5.0.0-beta.1 | factor | % improved
----------------------------------------------------------------------------------
exhaustMap - immediate | 1,452 (±1.14%) |   18,523 (±0.68%) | 12.76x |   1,175.5%
            exhaustMap | 4,941 (±0.29%) |   87,146 (±0.39%) | 17.64x |   1,663.8%
@kwonoj
Copy link
Member

kwonoj commented Feb 1, 2016

Change looks good to me.

@david-driscoll
Copy link
Member

I have a (potentially dumb question) will these change affect the flame graph in any way? Or is the errorObject just a hold over from RxJS4?

@kwonoj
Copy link
Member

kwonoj commented Feb 1, 2016

I assume there won't be much changes, custom trycatcher is simply wraps trycatch by

function tryCatcher(): any {
  try {
    return tryCatchTarget.apply(this, arguments);
  } catch (e) {
    errorObject.e = e;
    return errorObject;
  }
}

call stack may look slightly difference by catching internally.

@kwonoj
Copy link
Member

kwonoj commented Feb 1, 2016

just curious @david-driscoll , any particular concern you have in mind?

@david-driscoll
Copy link
Member

nope, just curious if it was related to handling the flamegraphs at all. I know in the past the common error object was used for creating custom callback chains (I think, but it's been a while).

@kwonoj
Copy link
Member

kwonoj commented Feb 1, 2016

This PR #1251 does have background explanations of reason to adapt these changes. Mainly about perf reasons.

@kwonoj kwonoj merged commit a55f459 into ReactiveX:master Feb 2, 2016
@kwonoj
Copy link
Member

kwonoj commented Feb 2, 2016

Merged with a55f459, thanks @luisgabriel .

@luisgabriel luisgabriel deleted the exhaustMap-perf branch February 2, 2016 12:55
@lock
Copy link

lock bot commented Jun 7, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants