Apply Optimize Java 8 Stream refactoring#106
Apply Optimize Java 8 Stream refactoring#106khatchad wants to merge 1 commit intoThreeTen:masterfrom
Conversation
|
In most cases, using Applying an automatic tool like this also misses out on the documentation changes that should go with changing the stream to be parallel. I hope you haven't sent out too many PRs, as your proposed changes make library code worse, not better. Sorry. |
|
Hi @jodastephen. Thank you for the feedback. Indeed, the tool does not currently account for documentation changes. Also, it's focus is on client code, and I did notice that the tool made an explicitly sequential stream (through a boolean argument) parallel. I should also note that it is also possible for the tool to de-parallelize a stream and unorder it to make parallel processing more efficient. Though, that was not the case in your particular project. |
Apply Optimize Java 8 Streams Refactoring
Description
This is a semantics-preserving automated refactoring that attempts to optimize code using Java 8 streams when it is safe and possibly advantageous to do so. It may make certain streams parallel, others sequential, and unorder streams where necessarily. The tool does not add new functionality; it only rearranges existing code in an effort to increase its performance. Your program's results should be the same before and after the refactoring.
Details
Performance Evaluation
We did not find dedicated performance tests in your project (please let us know if we missed it). But, we did evaluate our tool on other projects (see iluwatar/java-design-patterns#786 (comment) and numenta/htm.java#539 (comment)). We have found an average speedup of ~3.25 as a result of our refactoring across all of our tests thus far.
Feedback
Thank you for your help in this evaluation! Any feedback you can provide would be very helpful. In particular, we are interested if each of the proposed changes are helpful or not.