-
-
Notifications
You must be signed in to change notification settings - Fork 365
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
replace Boost is NaN test #101
Comments
Bob, can you attach the code used for timing? Or check it into the I'm curious about the overall timing numbers just measured from the outside On Fri, May 31, 2013 at 3:31 PM, Bob Carpenter notifications@github.comwrote:
|
I didn't use any new code for timing. I used Instruments from Xcode Checking nan was taking up 5% of the total compute time!
On 5/31/13 3:38 PM, Daniel Lee wrote:
|
Tested with following code in g++ and clang++ (-O3 -g for both), and found no difference between Stan's check_not_nan function and just using (x != x) hack to detect NaNs. I didn't profile how much time the NaN tests were taking of the total, but I think we do need the test. (g++ was about 5% faster than clang++ when the branch in the test wasn't predictable.) The following code produces 6 tests, all of which were run under g++ and clang++. All were same speed other than the unpredictable branch version, which was 10% slower under clang++ and 4% slower under g++.
|
I just compared (x != x) to boost::math::isnan() and found the run times On Wed, Jun 19, 2013 at 3:12 PM, Bob Carpenter notifications@github.comwrote:
|
The current use of Boost's isNaN test is taking up to 5% of total run time.
The text was updated successfully, but these errors were encountered: