← 输入框|github.com|刷新
Skip to content

1.x: measure flatMap/concatMap performance when used as filter - #3754

Merged
akarnokd merged 1 commit into
ReactiveX:1.xfrom
akarnokd:FlatMapAsFilterPerf
Mar 13, 2016
Merged

akarnokd merged 1 commit into
ReactiveX:1.xfrom
akarnokd:FlatMapAsFilterPerf

Conversation

@akarnokd

Copy link
Copy Markdown
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
Copy Markdown
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