From: Nikodemus S. <nik...@ra...> - 2011-02-11 17:42:44
|
1.0.45.20: optimize ERROR and CERROR They were both surprisingly slow as we looked for a *STACK-TOP-HINT* before calling SIGNAL. The hint is needed (and was used) only for the INVOKE-DEBUGGER case, however, so there is no need to pay that price if SIGNAL is enough -- eg. when there's a handler. Fixes lp#715191. Also missing NEWS items for the CTOR hackery. Index: NEWS =================================================================== RCS file: /cvsroot/sbcl/sbcl/NEWS,v retrieving revision 1.1863 diff -u -r1.1863 NEWS --- NEWS 11 Feb 2011 17:25:55 -0000 1.1863 +++ NEWS 11 Feb 2011 17:41:22 -0000 @@ -1,6 +1,11 @@ ;;;; -*- coding: utf-8; fill-column: 78 -*- changes relative to sbcl-1.0.45: * enhancement: largefile support on Solaris. + * optimization: ERROR and CERROR are approximately 5 times faster. + * optimization: optimized constructors are used for MAKE-INSTANCE of classes + with applicable non-standard (SETF SLOT-VALUE-USING-CLASS), + SLOT-BOUNDP-USING-CLASS, and INITIALIZE-INSTANCE :AROUND methods, speeding + up instance creation in those cases. * bug fix: local tail calls to DYNAMIC-EXTENT functions can no longer cause lifetime analysis to overwrite closed-over variables (lp#681092). * bug fix: encoding errors from some multibyte external formats such as EUC-JP Index: version.lisp-expr =================================================================== RCS file: /cvsroot/sbcl/sbcl/version.lisp-expr,v retrieving revision 1.5167 diff -u -r1.5167 version.lisp-expr --- version.lisp-expr 11 Feb 2011 17:34:46 -0000 1.5167 +++ version.lisp-expr 11 Feb 2011 17:41:22 -0000 @@ -20,4 +20,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".) -"1.0.45.19" +"1.0.45.20" Index: src/code/cold-error.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/code/cold-error.lisp,v retrieving revision 1.21 diff -u -r1.21 cold-error.lisp --- src/code/cold-error.lisp 7 Apr 2007 01:13:23 -0000 1.21 +++ src/code/cold-error.lisp 11 Feb 2011 17:41:23 -0000 @@ -110,14 +110,16 @@ (infinite-error-protect (let ((condition (coerce-to-condition datum arguments - 'simple-error 'error)) - (sb!debug:*stack-top-hint* (maybe-find-stack-top-hint))) + 'simple-error 'error))) (/show0 "done coercing DATUM to CONDITION") + (/show0 "signalling CONDITION from within ERROR") (let ((sb!debug:*stack-top-hint* nil)) - (/show0 "signalling CONDITION from within ERROR") (signal condition)) (/show0 "done signalling CONDITION within ERROR") - (invoke-debugger condition)))) + ;; Finding the stack top hint is pretty expensive, so don't do + ;; it until we know we need the debugger. + (let ((sb!debug:*stack-top-hint* (maybe-find-stack-top-hint))) + (invoke-debugger condition))))) (defun cerror (continue-string datum &rest arguments) (infinite-error-protect @@ -126,12 +128,12 @@ (let ((condition (coerce-to-condition datum arguments 'simple-error - 'cerror)) - (sb!debug:*stack-top-hint* (maybe-find-stack-top-hint))) + 'cerror))) (with-condition-restarts condition (list (find-restart 'continue)) (let ((sb!debug:*stack-top-hint* nil)) (signal condition)) - (invoke-debugger condition))))) + (let ((sb!debug:*stack-top-hint* (maybe-find-stack-top-hint))) + (invoke-debugger condition)))))) nil) ;;; like BREAK, but without rebinding *DEBUGGER-HOOK* to NIL, so that |