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

Apply optimize stream refactoring. #140

Closed
wants to merge 1 commit into from

Conversation

khatchad
Copy link

@khatchad khatchad commented Mar 26, 2018

We are in the process of evaluating a research project associated with an automated refactoring tool that attempts to optimize Java 8 streams for maximum performance. In the case of your project, it converted several streams to parallel. The tool is very conservative, meaning that it goes through an extensive static analysis to ensure that the transformation is safe, i.e., original program semantics have been preserved. However, this also means that the proposed changes can be a proper subset of all streams that could be optimized (say, by a human expert developer).

We also ran your test suite before and after our changes and verified that the test results matched. In your project's case, both versions past all tests.

We would appreciate any feedback on the change set that you have. If the changes are acceptable to you, we would also appreciate it if you could accept this pull request so that we may assess the impact of our tool. Thank you for your time and consideration!

@luontola
Copy link
Owner

Thanks but those spots will not benefit from parallelism. The streams have low number of elements (<20), so the overhead of thread switching will probably make the parallel version slower. And the part that most likely is the bottleneck in this application (bytecode loading) cannot be parallelized, or would complicate the program needlessly, and anyways it runs fast enough.

@luontola luontola closed this Mar 27, 2018
@khatchad
Copy link
Author

khatchad commented Mar 27, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants