ezunits fundamental_units quite slow

Michael Soegtrop via Maxima-discuss <[email protected]> Sat, 16 May 2026 10:32:05 +0200
Newsgroups gmane.comp.mathematics.maxima.general
Message-ID <[email protected]>
Dear Maxima Users,

ezunits in general feels quite fast now - as mentioned in a previous 
post I have been using a faster patched version I hacked together 2 
years back. This broke with 5.49.0 and switching back to the standard 
version I don't feel much of a difference - with one exception: 
fundamental_units is still very slow - it takes on average more than 
100ms per call on a reasonable CPU. This are several 100 million 
instructions to convert N to kg*m/s^2 - which is weird.

Using fundamental_units_cached[u]:=fundamental_units(u)$ instead gets 
one project down from 26s to 20s, even though I use fundamental_units 
only on input parameters (otherwise terms get too large because ezunits 
does not add compatible but not identical units).

I am fairly sure that this does not use any patches from me (I 
scrutinized my user maxima folder).

Below are some benchmark results.

Best regards,

Michael

(%i1)    load(ezunits)$
(%i2)    build_info();
(%o2)    build_info(version="5.49.0",timestamp="2026-01-02 
21:27:51",host="x86_64-w64-mingw32",lisp_name="SBCL",lisp_version="2.6.0",maxima_userdir="C:/Users/Michael/maxima",maxima_tempdir="C:/Users/Michael/AppData/Local/Temp",maxima_objdir="C:/Users/Michael/maxima/binary/5_49_0/sbcl/2_6_0",maxima_frontend="wxMaxima",maxima_frontend_version="26.01.0_MSW")

(%i5)    tmp: elapsed_real_time()$
     for i from 1 thru 100 do fundamental_units(N)$
     elapsed_real_time() - tmp;
(%o5)    11.984542

(%i8)    tmp: elapsed_real_time()$
     for i from 1 thru 100 do fundamental_units(J)$
     elapsed_real_time() - tmp;
(%o8)    12.409666000000001

(%i11)    tmp: elapsed_real_time()$
     for i from 1 thru 100 do fundamental_units(W)$
     elapsed_real_time() - tmp;
(%o11)    12.819502

(%i14)    tmp: elapsed_real_time()$
     for i from 1 thru 100 do fundamental_units(V)$
     elapsed_real_time() - tmp;
(%o14)    13.582403999999997




_______________________________________________
Maxima-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maxima-discuss