4 ms·
If he's really going for optimization, he might consider passing in the 'ret' array rather than creating a new one each time. (Or even better, using multiple-va
by ohyes 16y ago
If he's really going for optimization, he might consider passing in the 'ret' array rather than creating a new one each time. (Or even better, using multiple-values return to pass them stack allocated).
It also might be good to use a macro or compiler macro to unroll the loops, then you don't have to worry about manipulating 2 looping pointers. All you'd end up with is a bunch of constant arefs and addition/multiplication.
He also might want to set debug to 0, although I don't have any way to test that (or any of this) at the moment.
Then you get something that looks like this:
http://paste.lisp.org/display/120946 http://paste.lisp.org/display/120946
I haven't tested it (I don't even know if it works!), but the disassembly looks faster...
/rampant speculation.