looking for bottlenecks, was: property lisp hack



The inpart function is a bit pokey (but not a big-oh kind of pokey). Using
inpart, adding the members of a 500 x 500 integer-valued matrix takes 11.57
seconds. My aref and from scratch inpart function (might be lacking some features
or have bugs) does this in about 2.45 seconds.

Also, surely the testsuite calls the function for equality testing (it isn't alike)
many times. This function (I wrote (maybe large) parts of it) was *not* the result
of weeks of performance tweaking. Maybe the run time of the testsuite is hampered
by this function. As I recall, previously the testsuite did a bunch of equality
tests, including grinding expressions and doing string equality.

(%i1) N : 500$

(%i2) m : genmatrix(lambda([i,j],1),N,N)$

(%i3) showtime : all$

(%i4) (s : 0, for i : 1 thru N do for j : 1 thru N do s : s + inpart(m,i,j));
Evaluation took 11.5700 seconds (11.5700 elapsed)
(%o4) done

(%i5) (s : 0, for i : 1 thru N do for j : 1 thru N do s : s + m[i,j]);
Evaluation took 11.9500 seconds (11.9500 elapsed)
(%o5) done

(%i6) load("aref")$

(%i7) (s : 0, for i : 1 thru N do for j : 1 thru N do s : s + aref(m,i,j));
Evaluation took 2.4500 seconds (2.4500 elapsed)
(%o7) done

(%i8) (s : 0, for i : 1 thru N do for j : 1 thru N do s : s + inpart(m,i,j));
Evaluation took 2.4500 seconds (2.4500 elapsed)
(%o8) done

--Barton