[Openmcl-devel] optimizing number code
mb at bese.it
Thu Aug 26 12:31:37 EDT 2004
i have a tight loop which executes these two forms about 400K times:
(incf vs_i-mag (abs vs_i_j))
(incf dot-product (abs (* vs_i_j (aref q j))))
according to TIME these forms allocate about 5MB, which seems like a
lot. they only use about 600ms of time, but that's drawrfed by the 5
seconds spent doing gc. anyway, i've tried adding in all the type
declarations i can, and i can't seem to get openmcl to not cons. any
suggestions? i know vs_i_j is a double-float, as is (aref q j), and i
know the result of the * won't over/under-flow nor will the repeated
p.s. - i discoverd this hotspot by commenting forms one at a time and
embedding calls to TIME and random places, is there a better way?
Ring the bells that still can ring.
Forget your perfect offering.
There is a crack in everything.
That's how the light gets in.
More information about the Openmcl-devel