-
Notifications
You must be signed in to change notification settings - Fork 168
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
Use stream instead of parallelStream #437
Conversation
Ran it on our codebase Before:
After
Looks good |
buildSrc/build.gradle
Outdated
@@ -46,7 +46,7 @@ task sourcesJar(type: Jar) { | |||
classifier = 'sources' | |||
} | |||
|
|||
def publishVersion = '0.20.7' | |||
def publishVersion = '0.20.8-SNAPSHOT' |
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.
Can you revert this?
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.
Isn't it typical to bump the version to the next release snapshot? This makes it easier to test changes locally.
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.
you can do so if you want to locally. Even if we wanted to start doing that, it should be a separate change
The overhead of creating threads for very small tasks might not be faster than performing the same tasks serially. I ran a benchmark using this commit against our repo. I killed the gradle daemon and then ran the okbuck task 3 times. Before: using parallel() 20.353 secs 6.644 secs 5.89 secs After: using stream() 18.539 secs 6.316 secs 5.613 secs The results were quite similar with and without parallel stream. I'm wondering if there is any noticeable difference with even larger projects.
Removed snapshot version! |
* uber/master: Use stream instead of parallelStream (uber#437) Add empty resource rule if using resource union. (uber#438) Publich v0.20.7 Move okbuck task to its own gradle task class. (uber#436) Use try-with-resources (uber#432) Update README.md Do not allow okbuck to be run without okbuck.wrapper set to true. (uber#433) Set descriptions in tasks class instead of when creating them. (uber#431) Move cleaning the .okbuck/gen folder to the first step of setupOkbuck. (uber#430) Publish v0.20.6 Add support for downloading 22-25 API robolectric runtime dependencies. (uber#427) Skip okbuck if we just want to kill the buck daemon. (uber#425)
The overhead of creating threads for very small tasks might not be
faster than performing the same tasks serially.
I ran a benchmark using this commit against our repo. I killed the
gradle daemon and then ran the okbuck task 3 times.
Before: using parallel()
20.353 secs
6.644 secs
5.89 secs
After: using stream()
18.539 secs
6.316 secs
5.613 secs
The results were quite similar with and without parallel stream. I'm
wondering if there is any noticeable difference with even larger projects.