Reduce code size of call to SB-KERNEL:ASSERT-ERROR
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The internal function SB-KERNEL:
Instead, change SB-KERNEL:
To get some idea of the savings, look at this code, which measures the caller overhead for invoking something that looks like SB-KERNEL:
(defun ig (&rest args) (declare (ignore args)) nil)
(declaim (notinline ig))
(defun f1 (x y)
(ig '(eql x y) (list (list 'x x) (list 'y y)) nil "?"))
(defun f2 (x y)
(ig '(eql x y) '(x y) (list x y) nil "?"))
(defun g1 (x)
(ig '(zerop x) (list (list 'x x)) nil "?"))
(defun g2 (x)
(ig '(zerop x) '(x) (list x) nil "?"))
When compiled and disassembled, g1 -> g2 shrinks from 188 to 113 bytes, and
f1 -> f2 shrinks from 282 to 128 bytes (x86-64, Linux).
Further optimization could be obtained by specializing SB-KERNEL:
description: | updated |
description: | updated |
Changed in sbcl: | |
status: | New → Fix Committed |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |