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: measure flatMap/concatMap performance when used as filter #3754

Merged
merged 1 commit into from
Mar 13, 2016

Conversation

akarnokd
Copy link
Member

This PR adds a perf class to measure the overhead of using empty() when the flatMap/concatMap emulates filter.

This will establish the comparison baseline for flatMap/concatMap optimization as requested in #1653.

The baseline numbers (i7 4770K, Windows 7 x64, Java 8u72):

image

Comparing flatMap against concatMap:

image

Here, mask indicates the and-mask that makes emitting empty less frequent: 0 = always, 1 = every other, 3 = every fourth, 7 = every eighth. This also means that rangeEmpty starts emitting more and more values with higher mask value hence the different throughput values.

akarnokd added a commit that referenced this pull request Mar 13, 2016
1.x: measure flatMap/concatMap performance when used as filter
@akarnokd akarnokd merged commit a539151 into ReactiveX:1.x Mar 13, 2016
@akarnokd akarnokd deleted the FlatMapAsFilterPerf branch March 13, 2016 23:18
@davidmoten
Copy link
Collaborator

Thanks @akarnokd, very good of you. I'll set up a PR to use it.

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