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

CompositeSubscription performance increase #819

Merged

Conversation

akarnokd
Copy link
Member

@akarnokd akarnokd commented Feb 5, 2014

  • Optimized the case when the composite holds only a single element.
  • Replaced Arrays.copyOf with regular arraycopy to avoid the cost of reflective array creation
  • Included perf test where I got 32% increase on my i7 4770K

@cloudbees-pull-request-builder

RxJava-pull-requests #739 SUCCESS
This pull request looks good

@benjchristensen
Copy link
Member

The things we do for performance :-)

Very nice changes.

Old code on my machine:

Run: 10 - 14,477,981 ops/sec
Run: 11 - 14,028,905 ops/sec
Run: 12 - 14,738,523 ops/sec
Run: 13 - 14,296,743 ops/sec
Run: 14 - 14,643,646 ops/sec

New code:

Run: 10 - 20,500,289 ops/sec
Run: 11 - 19,725,110 ops/sec
Run: 12 - 20,433,601 ops/sec
Run: 13 - 19,659,111 ops/sec
Run: 14 - 20,011,446 ops/sec

benjchristensen added a commit that referenced this pull request Feb 5, 2014
CompositeSubscription performance increase
@benjchristensen benjchristensen merged commit b521d18 into ReactiveX:master Feb 5, 2014
@headinthebox
Copy link
Contributor

Like!

@akarnokd akarnokd deleted the CompositeSubscriptionPerf4 branch May 6, 2014 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants