Re: ezunits fundamental_units quite slow
Robert Dodier <[email protected]> Mon, 18 May 2026 08:47:46 -0700
| Newsgroups | gmane.comp.mathematics.maxima.general |
|---|---|
| Message-ID | <CAAsY_sTN--vymwbNGwx7fbuW1_SQJgEpORpzNPnkTtBQSkyUJw@mail.gmail.com> |
Michael, thanks a lot for investigating.
I used the 'timer' function in Maxima to see how much time was being
spent in various functions, and it appears the biggest time sink is a
defrule function named rff, namely:
(%i57) disprule (rff);
(%t57) rff : dimensions(ff%) -> block([ff%2 : ev(ff%,
args(known_unit_conversions), infeval)],
if ff%2 # ff% then dimensions(ff%2) else dimensions(ff%))
where
(%i58) printprops (ff%, matchdeclare);
(%o58) [lambda([e%], symbolp(e%))(ff%)]
so rff is converting units to the most basic units (i.e., the ones
that everything else is defined in terms of).
That's implemented via ev(expr, [foot = 328/100*m, inch = foot/12, km
= 1000*m, ...]) which is simple but time consuming,
I've been meaning for years to rework that bit, now it's time, I
think. Let me see what I can figure out. If you have an idea, I'd be
glad to hear it.
Robert