Custom Query (1030 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (634 - 636 of 1030)

Ticket Resolution Summary Owner Reporter
#1338 fixed Last could be faster Andrew Shalit
Description

cl:last could be faster by implementing some special cases and open coding the general case.

I looked at the sbcl source for LAST, and we may have both guessed at least
partly right.

As i understand the code, they special-case both the case where N=0 and the
one where N=1, and  a  simpler iterative loop in each of those cases, and
a more generaj iterative loop for other values of N.

In addition. a compiler-macro is defined on LAST, which may expand
into one of the simpler loops if N is constant and does not call out-of-line
code in any event .
#1269 fixed Lambdas don't optimize Gary Byers Shannon Spires
Description

Optimization works on defun forms like the following:

(defun fptest1 (a b)
  (declare (optimize (speed 3) (safety 1) (debug 1))
           (single-float a b))
  (+ a b))

(disassemble 'fptest1)

We can see from the disassembly that it's using the addss* instruction and not calling .SPBUILTIN-PLUS, so we know the optimization is happening.

[*addss is X86. The ARM equivalent is fadds.]

But lambda forms like the following don't optimize in CCL:

(defun fptest8 ()
  (declare (optimize (speed 3) (safety 0) (debug 0)))
  (lambda (a b)
    (declare (optimize (speed 3) (safety 0) (debug 0))
             (single-float a b))
    (+ a b)))

(disassemble (fptest8))

Because the disassembly contains the telltale line (jmpq (@ .SPBUILTIN-PLUS)), we know that optimization isn't happening.

However, the following works:

(defparameter fptest14
        (lambda (a b)
          (declare (optimize (speed 3) (safety 1) (debug 1))
                   (single-float a b))
          (+ a b)))

(disassemble fptest14)

As you can see, the resulting disassembly has no call to .SPBUILTIN-PLUS but rather it calls (addss (% fp1) (% fp0)), indicating optimization is happening. So using a global variable rather than a defun seems to be a partial workaround for anonymous functions, but not closures.

#1099 fixed LOOP named NIL does not establish a BLOCK R. Matthew Emerson Stelian Ionescu
Description

(loop named nil do (return 1)) does not establish a block at all instead of one named NIL, as I'd expect from 6.1.1.5.6: "The loop named construct gives a name for the block of the loop". There's no mention that specifying the name as NIL instead of defaulting to NIL through omission allows for the omission of the loop block.

Batch Modify
Note: See TracBatchModify for help on using batch modify.
Note: See TracQuery for help on using queries.