Subject: quad_qag slow due to compilation at each step?
From: dlakelan
Date: Wed, 12 Mar 2008 13:51:34 -0700
Raymond Toy (RT/EUS) wrote:
> Richard Fateman wrote:
>> OK, that makes it more complicated, but still possible to disable.
>>
>> The last time I did a comparison, CMU-CL's compiler was something like 20X
>> slower than
>> Allegro CL's compiler. That was on a Sun workstation, probably 10 years
>> ago.
>
> It's probably still 20X slower, if not more.
>
>> So if it turns out that compilation is really a large portion of the run
>> time,
>> there may be alternatives in other lisps. (SBCL is a descendant of CMU-CL).
>
> Last time I heard, SBCL was at least as slow as CMUCL.
>
> Clisp has a fast compiler, as does openmcl. GCL is even slower than
> CMUCL (because it calls the C compiler) at least for small functions.
> GCL might be faster than CMUCL for large functions.
It looks like the code disables compilation for GCL, probably due to the
cost of compiling. It would be nice if we could have a switch for
quad_qag and friends that determines whether they call compile or not.
for example, the call to quad_qag would look like:
quad_qag(fcn,var,a,b,epsrel,compilep);
if compilep is true then compile, otherwise not. Leave the default value
as compilep=true.
However, I just tested a simplified function with romberg, and it's
slightly slower, so quad_qag is doing an ok job. Perhaps what I need is
a root finder that converges faster than find_root.