From: Alexander Kjeldaas <astor@pv...>  20050628 23:25:43

I looked at the BITVECTOR benchmark in clbench in order to see if it could easily be optimized. Unfortunately I saw that 90% of the time seems to be spent on cachemisses(?) due to the resultarray of the BITAND operation not having dynamic extend. Introducing the dummy variable in the code below makes it roughly 10x faster. The code from clbench: (locally (declare (optimize (speed 3) (safety 0) (debug 0))) (defun benchbitvectors (&optional (size 1000000) (runs 700)) (declare (fixnum size)) (let ((zeros (makearray size :elementtype 'bit :initialelement 0)) (ones (makearray size :elementtype 'bit :initialelement 1)) (xors (makearray size :elementtype 'bit))) (dotimes (runs runs) (bitxor zeros ones xors) (bitnand zeros ones xors) (let ((dummy (makearray size :elementtype 'bit))) (declare (dynamicextent dummy)) (bitand zeros xors dummy)) #+nil (bitand zeros xors))) (values))) Now, since BITAND is in the COMMONLISP package and thus can not be redefined, would it be possible to detect that the result of BITAND is not used and to allocate the result array using dynamic extent? astor 