0.8.8.30:
authorChristophe Rhodes <csr21@cam.ac.uk>
Wed, 17 Mar 2004 20:24:16 +0000 (20:24 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Wed, 17 Mar 2004 20:24:16 +0000 (20:24 +0000)
Remove unnecessary bounds checks from REPLACE, VECTOR-POP and
VECTOR-PUSH-EXTEND (Juho Snellman sbcl-devel 2004-03-17)

CREDITS
NEWS
src/code/array.lisp
src/code/seq.lisp
version.lisp-expr

diff --git a/CREDITS b/CREDITS
index cc6b6d1..bb87d4b 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -651,6 +651,10 @@ Nikodemus Siivola:
   He provided build fixes, in particular to tame the SunOS toolchain,
   and has fixed many (stream-related and other) bugs besides.
 
+Juho Snellman:
+  He provided several performance enhancements, including a better hash
+  function on strings, and removal of unneccessary bounds checks.
+
 Brian Spilsbury:
   He wrote Unicode-capable versions of SBCL's character, string, and
   stream types and operations on them.
diff --git a/NEWS b/NEWS
index 180f239..61d8a4b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2330,6 +2330,8 @@ changes in sbcl-0.8.9 relative to sbcl-0.8.8:
   * optimization: the hash algorithm for strings has changed to one
     that is less vulnerable to spurious collisions.  (thanks to Juho
     Snellman)
+  * optimization: VECTOR-POP, VECTOR-PUSH-EXTEND and REPLACE do less
+    needless bounds checking.  (thanks to Juho Snellman)
   * optimization: implemented multiplication as a modular
     (UNSIGNED-BYTE 32) operation on the PPC backend.
   * fixed some bugs revealed by Paul Dietz' test suite:
index 733b8c3..0a76afa 100644 (file)
     (declare (fixnum fill-pointer))
     (when (= fill-pointer (%array-available-elements vector))
       (adjust-array vector (+ fill-pointer extension)))
-    (setf (aref vector fill-pointer) new-element)
+    ;; disable bounds checking
+    (locally (declare (optimize (safety 0)))
+      (setf (aref vector fill-pointer) new-element))
     (setf (%array-fill-pointer vector) (1+ fill-pointer))
     fill-pointer))
 
     (declare (fixnum fill-pointer))
     (if (zerop fill-pointer)
        (error "There is nothing left to pop.")
-       (aref array
-             (setf (%array-fill-pointer array)
-                   (1- fill-pointer))))))
+       ;; disable bounds checking (and any fixnum test)
+       (locally (declare (optimize (safety 0)))
+         (aref array
+               (setf (%array-fill-pointer array)
+                     (1- fill-pointer)))))))
+
 \f
 ;;;; ADJUST-ARRAY
 
index 777ee4a..d7d1f43 100644 (file)
                            (1- source-index)))
             ((= target-index (the fixnum (1- target-start))) target-sequence)
           (declare (fixnum target-index source-index))
+          ;; disable bounds checking
+          (declare (optimize (safety 0)))
           (setf (aref target-sequence target-index)
                 (aref source-sequence source-index))))
        (do ((target-index target-start (1+ target-index))
                (= source-index (the fixnum source-end)))
            target-sequence)
         (declare (fixnum target-index source-index))
+        ;; disable bounds checking
+        (declare (optimize (safety 0)))
         (setf (aref target-sequence target-index)
               (aref source-sequence source-index)))))
 
index 16835dc..061a950 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.8.8.29"
+"0.8.8.30"