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: optimize collect, reduce and takeLast(1) #4176

Merged
merged 4 commits into from
Jul 8, 2016

Conversation

akarnokd
Copy link
Member

@akarnokd akarnokd commented Jul 7, 2016

This PR reduces the overhead with collect, reduce and takeLast and introduces the DeferredScalarSubscriber to support similar unbounded-in single-out scenarios.

Benchmark comparison (i7 4770K, Windows 7 x64, Java 8u92)

image

Relative to each other: (each practically returning the very last value)

image

@akarnokd akarnokd added this to the 1.2 milestone Jul 7, 2016
@@ -0,0 +1,177 @@
/**
* Copyright 2015 Netflix, Inc.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2016? The class this came from had 2016 as well

@akarnokd
Copy link
Member Author

akarnokd commented Jul 7, 2016

Updated header year, @JakeWharton .

@JakeWharton
Copy link
Contributor

lgtm 👍

@codecov-io
Copy link

codecov-io commented Jul 7, 2016

Current coverage is 81.42%

Merging #4176 into 1.x will decrease coverage by 0.01%

@@                1.x      #4176   diff @@
==========================================
  Files           257        261     +4   
  Lines         16823      16921    +98   
  Methods           0          0          
  Messages          0          0          
  Branches       2550       2554     +4   
==========================================
+ Hits          13701      13778    +77   
- Misses         2224       2247    +23   
+ Partials        898        896     -2   

Powered by Codecov. Last updated by 20ef857...3da558a

@akarnokd
Copy link
Member Author

akarnokd commented Jul 7, 2016

/cc @artem-zinnatullin was it you that wanted more unit test coverage for the deferred-scalar algorithm?

@akarnokd akarnokd merged commit 978825e into ReactiveX:1.x Jul 8, 2016
@akarnokd akarnokd deleted the DeferredScalarOpt branch July 8, 2016 07:05
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.

None yet

3 participants