
----------------------------------------
From: john@johnmaddock.co.uk To: boost-users@lists.boost.org Date: Sat, 5 Sep 2009 11:11:51 +0100 Subject: Re: [Boost-users] [math] gamma distribution's quantile performance
Hi there, I have created a test which times the performance of boost::math::quantile( ... ) when using a gamma distribution. I ran it against source code we use here at work, for ages. It can be found here:
http://people.sc.fsu.edu/~burkardt/cpp_src/dcdflib/dcdflib.html
The old source code is about 2x times faster than the boost version.
MS Visual Studio 2005: boost: 35.4sec att_bell:19sec
Intel 11.1: boost: 21.4sec att_bell: 11.2sec
Question is if there is a way to incorporate such a function into boost::math? As far, as I can tell the results are almost identical.
I'll need to investigate this some more and perhaps incorporate testing dcdflib into my own test suite - however:
* I notice we're actually using the same algorithm internally, I'll need to investigate the dcdflib code in more detail to figure out why it's faster, but I suspect it may be down to what the chosen accuracy is.
Forgive the simple question but what compiler options did you use? My concern with OO code is that it always relies on compilers to "fix" things and it is possible that debug builds of C code will be much faster than those of OO code. In particular, simple things like inlining in inner loops etc. Fully optimized this is no problem but otherwise could be a big deal.
* The Boost version is known to be robust and tested over a very wide range of inputs, it produces accurate results even when the result is very small or close to 1. * The Boost version is ~twice as fast as the R lib version.
Of course #2 and #3 above may be of little consolation to you :-(
I'm going to be offline shortly for at least a couple of weeks (we have builders coming in), but I'll try and get back to you on this then - actually it might help if you file a bug report on the Trac at svn.boost.org so I can't forget :-)
Cheers, John.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_________________________________________________________________ Windows Live: Keep your friends up to date with what you do online. http://windowslive.com/Campaign/SocialNetworking?ocid=PID23285::T:WLMTAGL:ON...