Optimize make-values-type-cached by adding a declaration or two.
Building SBCL sans contribs goes from 1:52 to 1:39.
#+sb-bsd-sockets-addrinfo
(declaim (inline get-address-info))
-#+sb-bsd-sockets-addrinfo
+#+sb-bsd-sockets-addrinfo
(defun get-address-info (node)
(declare (optimize speed))
(sb-alien:with-alien ((info (* sockint::addrinfo)))
;;; our equality tests, because MEMBER and friends refer to EQLity.
;;; So:
(defun equal-but-no-car-recursion (x y)
- (cond
- ((eql x y) t)
- ((consp x)
- (and (consp y)
- (eql (car x) (car y))
- (equal-but-no-car-recursion (cdr x) (cdr y))))
- (t nil)))
+ (do () (())
+ (cond ((eql x y) (return t))
+ ((and (consp x)
+ (consp y)
+ (eql (pop x) (pop y))))
+ (t
+ (return)))))
\f
;;;; package idioms
(if rest
(type-hash-value rest)
42)
- (sxhash allowp))
+ (if allowp
+ #.(logand #xFF (sxhash t))
+ #.(logand #xFF (sxhash nil))))
#xFF)))
((required equal-but-no-car-recursion)
(optional equal-but-no-car-recursion)
#!-sb-fluid (declaim (inline type-list-cache-hash))
(declaim (ftype (function (list) (unsigned-byte 8)) type-list-cache-hash))
(defun type-list-cache-hash (types)
- (logand (loop with res = 0
- for type in types
- for hash = (type-hash-value type)
- do (setq res (logxor res hash))
- finally (return res))
- #xFF))
+ (logand #xFF
+ (loop with res fixnum = 0
+ for type in types
+ for hash = (type-hash-value type)
+ do (setq res (logxor res hash))
+ finally (return res))))
\f
;;;; cold loading initializations