-
Notifications
You must be signed in to change notification settings - Fork 336
Benchmarks for find() algorithm #325 #444
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
Conversation
Boost.Compute, STL and Thrust benchmarks for find() algorithm.
perf/perf_stl_find.cpp
Outdated
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.
So I tried running this version a few times with varying data sizes but always got the same very small time. This usually means the compiler is optimizing out the call the std::find() entirely because the result is not actually used. I'd add something to store the result in a variable and compare it against host_vector.end().
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.
I don't have that issue. Are performance tests built with -O3 by default?
Nevertheless, I will commit fix immediately and to be sure it won't happen again with Thrust performance test I will add there the same check.
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.
Not by default, but when I'm running the performance benchmarks and comparing against the STL I enable optimizations (else the results are not very fair). I usually do this by setting CMAKE_BUILD_TYPE=Release which enables gcc -03.
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.
Thanks! That's exactly what I need to know. From now on I will use that setting when testing performance, especially against STL.
|
Minor issue with the STL version. After fixing that it should be good to merge. Thanks! |
Making sure that compiler won't cut out std::find() and thrust:find() calls while optimizing the code.
|
It's interesting that Travis build failed. I'm not sure why. |
Benchmarks for find() algorithm #325
|
Looks great! Merged! |
|
And don't worry about the |
This addresses issue #325 .
I've added find() algorithm benchmarks for Boost.Compute, STL, Thrust. Benchmarks are based on worst-case scenario (searching for element that isn't in vector).