From 82fb802bdb525f4813c6b4bdf52316e3dc8b75dc Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Fri, 31 Oct 2008 12:43:44 +0000 Subject: [PATCH] 1.0.22.2: optimize output under *PRINT-PRETTY* * Don't construct the pretty stream when it is not needed. --- NEWS | 5 +++++ src/code/pprint.lisp | 9 +++++++-- version.lisp-expr | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 8d4ed0002..d08cc36aa 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,9 @@ ;;;; -*- coding: utf-8; -*- +changes in sbcl-1.0.23 relative to 1.0.22: + * optimization: printing with *PRINT-PRETTY* true is now more + efficient as long as the object being printed doesn't require + special handling by the pretty printer. + changes in sbcl-1.0.22 relative to 1.0.21: * minor incompatible change: LOAD-SHARED-OBJECT no longer by default looks for the shared object in the current directory, but passes the native diff --git a/src/code/pprint.lisp b/src/code/pprint.lisp index 5f9e6a4e8..89bac81df 100644 --- a/src/code/pprint.lisp +++ b/src/code/pprint.lisp @@ -1315,8 +1315,13 @@ line break." ;;; OUTPUT-PRETTY-OBJECT is called by OUTPUT-OBJECT when ;;; *PRINT-PRETTY* is true. (defun output-pretty-object (object stream) - (with-pretty-stream (stream) - (funcall (pprint-dispatch object) stream object))) + (multiple-value-bind (fun pretty) (pprint-dispatch object) + (if pretty + (with-pretty-stream (stream) + (funcall fun stream object)) + ;; No point in consing up a pretty stream if we are not using pretty + ;; printing the object after all. + (output-ugly-object object stream)))) (defun !pprint-cold-init () (/show0 "entering !PPRINT-COLD-INIT") diff --git a/version.lisp-expr b/version.lisp-expr index 17514c0e9..799273714 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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".) -"1.0.22.1" +"1.0.22.2" -- 2.11.4.GIT