The attached patch replaces the explicit loops in CLRHASH
[ (dotimes (i foo) (setf (aref bar i) constant)) ] with calls to FILL.
This seems both cleaner and faster (the latter is important since
the compiler is a rather heavy user of CLRHASH, this gets about 1-2%
improvement on cl-bench's COMPILER benchmark).
Juho Snellman <jsnell@...> writes:
> - (do ((i 2 (1+ i)))
> - ((>= i kv-length))
> - (setf (aref kv-vector i) +empty-ht-slot+))
> + (fill kv-vector +empty-ht-slot+ :start 2)
> (aver (eq (aref kv-vector 0) hash-table))
If we're going to be smart, then probably we should place the AVER
before the FILL. Why? Because FILL will start writing from or near
the beginning of the vector to the end, so we might as well access the
start of the vector before beginning to FILL, as it's likely to be
(Not really a serious criticism of the patch :-)
http://www-jcsu.jesus.cam.ac.uk/~csr21/ +44 1223 510 299/+44 7729 383 757
(set-pprint-dispatch 'number (lambda (s o) (declare (special b)) (format s b)))
(defvar b "~&Just another Lisp hacker~%") (pprint #36rJesusCollegeCambridge)
Get latest updates about Open Source Projects, Conferences and News.