[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#28625: [PROPOSED] Speed up (format "%s" STRING) and the like
From: |
Eli Zaretskii |
Subject: |
bug#28625: [PROPOSED] Speed up (format "%s" STRING) and the like |
Date: |
Fri, 29 Sep 2017 18:48:51 +0300 |
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Wed, 27 Sep 2017 11:52:12 -0700
> Cc: Paul Eggert <eggert@cs.ucla.edu>
>
> Although the Lisp manual said that ‘format’ returns a
> newly-allocated string, this was not true for a few cases like
> (format "%s" ""), and fixing the documentation to allow reuse of
> arguments lets us improve performance in common cases like
> (format "foo") and (format "%s" "foo").
> * doc/lispref/strings.texi (Formatting Strings):
> * etc/NEWS:
> Say that the result of ‘format’ might not be newly allocated.
> * src/callint.c (Fcall_interactively):
> * src/dbusbind.c (XD_OBJECT_TO_STRING):
> * src/editfns.c (Fmessage, Fmessage_box):
> * src/xdisp.c (vadd_to_log, Ftrace_to_stderr):
> Just use Fformat or Fformat_message, as that’s simpler and no
> longer makes unnecessary copies.
> * src/editfns.c (styled_format): Remove last argument, as it
> is no longer needed: all callers now want it to behave as if it
> were true. All remaining callers changed. Make this function
> static again. Simplify the function now that we no longer
> need to worry about whether the optimization is allowed.
> ---
> doc/lispref/strings.texi | 10 +++++++---
> etc/NEWS | 7 +++++++
> src/callint.c | 4 ++--
> src/dbusbind.c | 3 +--
> src/editfns.c | 26 ++++++++++----------------
> src/lisp.h | 1 -
> src/xdisp.c | 4 ++--
> 7 files changed, 29 insertions(+), 26 deletions(-)
Fine with me for the release branch.
Thanks.
bug#28625: [PROPOSED] Speed up (format "%s" STRING) and the like,
Eli Zaretskii <=