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

1.x: concatMap full rewrite + delayError + performance #3759

Merged
merged 1 commit into from
Mar 15, 2016

Conversation

akarnokd
Copy link
Member

This is a full rewrite of the concat/concatMap operator with the following properties:

  • using OnSubscribe to save on the allocation of lift
  • concatDelayError and concatMapDelayError to delay errors to the very end
  • new trampolining logic that also subscribes to the next source even if requested is zero
  • using concatMap or concatMapDelayError on a scalar source now bypasses the operator completely and uses ScalarSynchronousObservable.scalarFlatMap as well.
  • the operator now detects just and empty sources and bypasses subscribing accordingly
  • added ExceptionsUtils to work with composite exceptions and terminal state; useful for other similar delaying operators later on.
  • concat is now implemented as concatMap(v -> v) which saves on the allocation of an entire map operator
  • OperatorWindowWithSizeTest.testBackpressureOuterInexact had to be ignored because window doesn't honor backpressure properly and it is fixed in 1.x: fix counted buffer and window backpressure #3678; once it has been resolved, the test can be reenabled
  • Added varargs constructor to CompositeException for convenience; avoids creating a list when the number of initial exceptions are known upfront.

Performance comparison to baseline (i7 4770K, Windows 7 x64, Java 8u72):

image

@akarnokd
Copy link
Member Author

This is the benchmark comparison against Rsc:

image

@stevegury
Copy link
Member

LGTM 👍

akarnokd added a commit that referenced this pull request Mar 15, 2016
1.x: concatMap full rewrite + delayError + performance
@akarnokd akarnokd merged commit 044620e into ReactiveX:1.x Mar 15, 2016
@akarnokd akarnokd deleted the OnSubscribeConcatMap1x branch March 15, 2016 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants