Custom Query (1030 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (742 - 744 of 1030)

Ticket Resolution Summary Owner Reporter
#1357 fixed Slowdown from appropriate type declaration in optimized code Matt Kaufmann
Description

A colleague noticed that the following function can run more slowly with a suitable type declaration. I've reproduced his results on Linux:

Welcome to Clozure Common Lisp Version 1.12-dev-r16729M-trunk (LinuxX8664)!

Here are the commands:

(declaim (OPTIMIZE (COMPILATION-SPEED 0) (DEBUG 0) (SPEED 3) (SPACE 0) (SAFETY 0)))
(defun fibonacci (n)
  (declare (type (integer 0 *) n))
  (if (= n 0)
      0
    (if (= n 1)
        1
      (+ (fibonacci (- n 1)) (fibonacci (- n 2))))))

Then:

? (time (fibonacci 38))
(FIBONACCI 38)
took 912,371 microseconds (0.912371 seconds) to run.
During that period, and with 8 available CPU cores,
     912,812 microseconds (0.912812 seconds) were spent in user mode
         804 microseconds (0.000804 seconds) were spent in system mode
 1 minor page faults, 0 major page faults, 0 swaps.
39088169
? 

But here we see the time cut in more than half when we remove the type declaration:

? (time (fibonacci 38))
(FIBONACCI 38)
took 383,980 microseconds (0.383980 seconds) to run.
During that period, and with 8 available CPU cores,
     382,068 microseconds (0.382068 seconds) were spent in user mode
       2,433 microseconds (0.002433 seconds) were spent in system mode
 1 minor page faults, 0 major page faults, 0 swaps.
39088169
? 
#1359 fixed REPLACE fails on vectors with fill-pointer Ivan Shvedunov
Description

CCL trunk, test:

(in-package :cl-user)

(let ((a (make-array 16 :element-type '(unsigned-byte 8) :fill-pointer 11))
      (b (make-array 16 :element-type '(unsigned-byte 8) :fill-pointer 10)))
  (replace a b :start1 1 :end1 11 :start2 0)
  (princ a))

Produces an error:

The value 16 is not of the expected type ARRAY.
[Condition of type TYPE-ERROR]

Restarts:
0: [RETRY] Retry SLIME interactive evaluation request.
1: [*ABORT] Return to SLIME's top level.
2: [ABORT-BREAK] Reset this thread
3: [ABORT] Kill this thread

Backtrace:
0: (CCL::%ARRAY-IS-HEADER 16)
Locals:
ARRAY = 16
1: (DISPLACED-ARRAY-P #<error printing (VECTOR CCL::UNUSED 10) #x302004A7459D>)
Locals:
ARRAY = #<error printing (VECTOR UNUSED 10) #x302004A7459D>
DISP = #(0 0 0 0 0 0 ...)
TARGET = 16
2: (CCL::WRITE-AN-ARRAY #<error printing (VECTOR CCL::UNUSED 10) #x302004A7459D> #<SWANK/GRAY::SLIME-OUTPUT-STREAM #x302000B6D05D> 1152921504606846975)
3: (#<CCL::STANDARD-KERNEL-METHOD PRINT-OBJECT (T T)> #<error printing (VECTOR CCL::UNUSED 10) #x302004A7459D> #<SWANK/GRAY::SLIME-OUTPUT-STREAM #x302000B6D05D>)
4: (CCL::%CALL-NEXT-METHOD (NIL #<CCL::STANDARD-KERNEL-METHOD PRINT-OBJECT (T T)> . 17592094079249))
5: (CCL::%%STANDARD-COMBINED-METHOD-DCODE (#<CCL::STANDARD-KERNEL-METHOD PRINT-OBJECT :AROUND (T T)> #<CCL::STANDARD-KERNEL-METHOD PRINT-OBJECT (T T)>) 17592094079249)
6: (NIL #<Unknown Arguments>)
7: (CCL::WRITE-A-FROB #<error printing (VECTOR CCL::UNUSED 10) #x302004A7459D> #<SWANK/GRAY::SLIME-OUTPUT-STREAM #x302000B6D05D> 1152921504606846975 NIL)
8: (CCL::WRITE-INTERNAL #<SWANK/GRAY::SLIME-OUTPUT-STREAM #x302000B6D05D> #<error printing (VECTOR CCL::UNUSED 10) #x302004A7459D> 1152921504606846975 NIL)
9: (CCL::WRITE-1 #<error printing (VECTOR CCL::UNUSED 10) #x302004A7459D> #<SWANK/GRAY::SLIME-OUTPUT-STREAM #x302000B6D05D> 1152921504606846975)
10: (PRINC #<error printing (VECTOR CCL::UNUSED 10) #x302004A7459D> NIL)
11: (CCL::CHEAP-EVAL (LET ((A (MAKE-ARRAY 16 :ELEMENT-TYPE '# :FILL-POINTER ...)) (B (MAKE-ARRAY 16 :ELEMENT-TYPE '# :FILL-POINTER ...))) (REPLACE A B :START1 1 :END1 ...) (PRINC A)))
12: ((:INTERNAL SWANK:INTERACTIVE-EVAL))

The culprit is %UVECTOR-REPLACE used in REPLACE function. It uses %SVREF which breaks on non-simple vectors.

Suggested patch is attached.

#1360 fixed Miscompilation on ARM Gary Byers Ivan Shvedunov
Description

CCL trunk, distilled from ITERATE load error. Note (BOUNDP 'VERSION) instead of "Current version of Iterate", DOC variable gets mixed up with another value.

CL-USER> (defun zzz (WHOLE ENVIRON)
           (DECLARE
            (IGNORABLE WHOLE ENVIRON))
           (BLOCK DEFCONST
             (LET* ((ARGS
                      (CCL::PREPARE-TO-DESTRUCTURE
                       (CDR WHOLE)
                       '(NAME VALUE &OPTIONAL DOC)
                       2
                       3))
                    (NAME (POP ARGS))
                    (VALUE (POP ARGS))
                    (DOC
                      (IF
                       ARGS
                       (POP ARGS)
                       'NIL)))
               
               (LIST*
                'UNLESS
                (LIST*
                 (LIST*
                  'BOUNDP
                  (LIST (LIST* 'QUOTE (LIST NAME))))
                 (LIST
                  (IF
                   DOC
                   (LIST*
                    'DEFCONSTANT
                    (LIST*
                     NAME
                     (LIST* VALUE (LIST DOC))))
                   (LIST*
                    'DEFCONSTANT
                    (LIST*
                     NAME
                     (LIST VALUE))))))))))
ZZZ
CL-USER> (print (zzz '(defconst version "1.4" "Current version of Iterate") nil))
(UNLESS (BOUNDP 'VERSION) (DEFCONSTANT VERSION "1.4" (BOUNDP 'VERSION)))

Original macro:

(defmacro defconst (name value &optional doc)
   `(eval-when (:compile-toplevel :load-toplevel :execute)
      (unless (boundp ',name)
        ,(if doc
             `(defconstant ,name ,value ,doc)
           `(defconstant ,name ,value)))))
Batch Modify
Note: See TracBatchModify for help on using batch modify.
Note: See TracQuery for help on using queries.