-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Convert to scan to use lift #790
Conversation
RxJava-pull-requests #711 FAILURE |
not sure what went wrong on cloud bees because it works locally from the command line and eclipse. |
RxJava-pull-requests #714 FAILURE |
@@ -63,244 +62,39 @@ public Double call(Double accu, Double next) { | |||
}); | |||
} | |||
|
|||
/** | |||
* Compute the sum by extracting integer values from the source via an |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the performance impact of using scan
instead of custom implementations for sums?
Despite it being elegant, the machinery in scan
far outweighs sum += i
so I'd like to know the performance hit.
RxJava-pull-requests #786 FAILURE |
RxJava-pull-requests #794 SUCCESS |
To answer @benjchristensen's question about the performance of sumInteger/Float/Long/Double. Originally half of the implementations were based on reduce(R, Func2<R, T, R) and the other half were custom. I just removed the custom code for reduce(Func2<T, T, T>) which has the behavior of throwing an error when the Observable is empty. I'm having a hard time imagining a critical situation for sum together an Observable numbers to justify so much custom code. |
Convert to scan to use lift
I switched the scan to an operator and cleaned up what looked like a lot of unnecessary code from the summing operations.