property list hack, profiling, compiler optimization, looking at code
Subject: property list hack, profiling, compiler optimization, looking at code
From: Richard Fateman
Date: Sun, 12 Aug 2012 06:34:30 -0700
On 8/12/2012 4:49 AM, Barton Willis wrote:
> ________________________________________
>
>> Looks like there are a bunch of places to make this program run faster.
>> zerop1 is near the top. risplit (real-imaginary-split ???) is there too.
> The trig simplification code calls both flonum-eval and big-float-eval. Both of these functions call
> $imagpart and $realpart. And both $imagpart and $realpart call risplit :(
>
> Fortunately for pure symbolic cases, such as cos(x), flonum-eval and big-float-eval bail out with out calling
> risplit.
>
>
> --bw
>
Building Macsyma sometimes consisted of the quest for the "optimal patch".
The code exists and works for its intended purpose, but now you have a
new case that
you want to be handled. Same for "fixing" Maxima.
You can check for this case right at the beginning of checking for
special cases,
or you can try to find the place that is at the far leaf of some
decision tree
that already exists.
Say that you return ind for indefinite as in 0/0. You want to
return ind for cos(ind).
Where do you patch cos? Right away, or after it checks for non-numeric
then atomic, then
not %pi? Or should the cos routine treat ind, inf, minf, intervals,
whatever.. etc are a different category, e.g.
pseudo-numbers and where should that check be. If something like
cos(x) is the most common
case, do you want that (non-) simplification to fall out at the very end
where the code has
exhausted all other cases?