From unknown Thu Aug 14 12:26:06 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#28625 <28625@debbugs.gnu.org> To: bug#28625 <28625@debbugs.gnu.org> Subject: Status: [PROPOSED] Speed up (format "%s" STRING) and the like Reply-To: bug#28625 <28625@debbugs.gnu.org> Date: Thu, 14 Aug 2025 19:26:06 +0000 retitle 28625 [PROPOSED] Speed up (format "%s" STRING) and the like reassign 28625 emacs submitter 28625 Paul Eggert severity 28625 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 27 14:52:39 2017 Received: (at submit) by debbugs.gnu.org; 27 Sep 2017 18:52:39 +0000 Received: from localhost ([127.0.0.1]:35343 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxHRn-0007VV-0t for submit@debbugs.gnu.org; Wed, 27 Sep 2017 14:52:39 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38558) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxHRk-0007VH-D5 for submit@debbugs.gnu.org; Wed, 27 Sep 2017 14:52:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dxHRd-0003lP-GV for submit@debbugs.gnu.org; Wed, 27 Sep 2017 14:52:31 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:56286) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dxHRd-0003lE-Cl for submit@debbugs.gnu.org; Wed, 27 Sep 2017 14:52:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxHRb-0007qb-Jx for bug-gnu-emacs@gnu.org; Wed, 27 Sep 2017 14:52:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dxHRX-0003iq-KU for bug-gnu-emacs@gnu.org; Wed, 27 Sep 2017 14:52:27 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:60094) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dxHRX-0003iW-Av for bug-gnu-emacs@gnu.org; Wed, 27 Sep 2017 14:52:23 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 6DDEF160E2F for ; Wed, 27 Sep 2017 11:52:21 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id QJy69-SXcqlg; Wed, 27 Sep 2017 11:52:20 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 259BA160E31; Wed, 27 Sep 2017 11:52:20 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id SqdEMgEehpqx; Wed, 27 Sep 2017 11:52:20 -0700 (PDT) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id A84FE160E2E; Wed, 27 Sep 2017 11:52:19 -0700 (PDT) From: Paul Eggert To: bug-gnu-emacs@gnu.org Subject: [PROPOSED] Speed up (format "%s" STRING) and the like Date: Wed, 27 Sep 2017 11:52:12 -0700 Message-Id: <20170927185212.1846-1-eggert@cs.ucla.edu> X-Mailer: git-send-email 2.13.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit Cc: Paul Eggert X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Although the Lisp manual said that =E2=80=98format=E2=80=99 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 =E2=80=98format=E2=80=99 might not be newly alloca= ted. * 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=E2=80=99s 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(-) diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index 219225d412..5a56ed14a1 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi @@ -812,15 +812,19 @@ Formatting Strings in how they use the result of formatting. =20 @defun format string &rest objects -This function returns a new string that is made by copying -@var{string} and then replacing any format specification -in the copy with encodings of the corresponding @var{objects}. The +This function returns a string equal to @var{string}, replacing any form= at +specifications with encodings of the corresponding @var{objects}. The arguments @var{objects} are the computed values to be formatted. =20 The characters in @var{string}, other than the format specifications, are copied directly into the output, including their text properties, if any. Any text properties of the format specifications are copied to the produced string representations of the argument @var{objects}. + +The output string need not be newly-allocated. For example, if +@code{x} is the string @code{"foo"}, the expressions @code{(eq x +(format x))} and @code{(eq x (format "%s" x))} might both yield +@code{t}. @end defun =20 @defun format-message string &rest objects diff --git a/etc/NEWS b/etc/NEWS index 1b5ae658f6..48f34d0df7 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1548,6 +1548,13 @@ Emacs integers with %e, %f, or %g conversions. Fo= r example, on these hosts (eql N (string-to-number (format "%.0f" N))) now returns t for all Emacs integers N. =20 ++++ +** 'format' is no longer documented to return a newly-allocated string. +This documentation was not correct, as (eq x (format x)) returned t +when x was the empty string. 'format' now takes advantage of the doc +change to avoid making copies of strings in common cases like (format +"foo") and (format "%s" "foo"). + --- ** Calls that accept floating-point integers (for use on hosts with limited integer range) now signal an error if arguments are not diff --git a/src/callint.c b/src/callint.c index 469205cc38..5d88082e38 100644 --- a/src/callint.c +++ b/src/callint.c @@ -272,7 +272,7 @@ invoke it. If KEYS is omitted or nil, the return val= ue of { /* `args' will contain the array of arguments to pass to the function. `visargs' will contain the same list but in a nicer form, so that i= f we - pass it to styled_format it will be understandable to a human. */ + pass it to Fformat_message it will be understandable to a human. *= / Lisp_Object *args, *visargs; Lisp_Object specs; Lisp_Object filter_specs; @@ -502,7 +502,7 @@ invoke it. If KEYS is omitted or nil, the return val= ue of for (i =3D 2; *tem; i++) { visargs[1] =3D make_string (tem + 1, strcspn (tem + 1, "\n")); - callint_message =3D styled_format (i - 1, visargs + 1, true, false= ); + callint_message =3D Fformat_message (i - 1, visargs + 1); =20 switch (*tem) { diff --git a/src/dbusbind.c b/src/dbusbind.c index 789aa00861..4a7068416f 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -237,8 +237,7 @@ static char * XD_OBJECT_TO_STRING (Lisp_Object object) { AUTO_STRING (format, "%s"); - Lisp_Object args[] =3D { format, object }; - return SSDATA (styled_format (ARRAYELTS (args), args, false, false)); + return SSDATA (CALLN (Fformat, format, object)); } =20 #define XD_DBUS_VALIDATE_BUS_ADDRESS(bus) \ diff --git a/src/editfns.c b/src/editfns.c index e326604467..92c8f0f005 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -74,6 +74,7 @@ static Lisp_Object format_time_string (char const *, pt= rdiff_t, struct timespec, static long int tm_gmtoff (struct tm *); static int tm_diff (struct tm *, struct tm *); static void update_buffer_properties (ptrdiff_t, ptrdiff_t); +static Lisp_Object styled_format (ptrdiff_t, Lisp_Object *, bool); =20 #ifndef HAVE_TM_GMTOFF # define HAVE_TM_GMTOFF false @@ -3958,7 +3959,7 @@ usage: (message FORMAT-STRING &rest ARGS) */) } else { - Lisp_Object val =3D styled_format (nargs, args, true, false); + Lisp_Object val =3D Fformat_message (nargs, args); message3 (val); return val; } @@ -3984,7 +3985,7 @@ usage: (message-box FORMAT-STRING &rest ARGS) */) } else { - Lisp_Object val =3D styled_format (nargs, args, true, false); + Lisp_Object val =3D Fformat_message (nargs, args); Lisp_Object pane, menu; =20 pane =3D list1 (Fcons (build_string ("OK"), Qt)); @@ -4140,7 +4141,7 @@ produced text. usage: (format STRING &rest OBJECTS) */) (ptrdiff_t nargs, Lisp_Object *args) { - return styled_format (nargs, args, false, true); + return styled_format (nargs, args, false); } =20 DEFUN ("format-message", Fformat_message, Sformat_message, 1, MANY, 0, @@ -4156,16 +4157,13 @@ and right quote replacement characters are specif= ied by usage: (format-message STRING &rest OBJECTS) */) (ptrdiff_t nargs, Lisp_Object *args) { - return styled_format (nargs, args, true, true); + return styled_format (nargs, args, true); } =20 -/* Implement =E2=80=98format-message=E2=80=99 if MESSAGE is true, =E2=80= =98format=E2=80=99 otherwise. - If NEW_RESULT, the result is a new string; otherwise, the result - may be one of the arguments. */ +/* Implement =E2=80=98format-message=E2=80=99 if MESSAGE is true, =E2=80= =98format=E2=80=99 otherwise. */ =20 Lisp_Object -styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message, - bool new_result) +styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) { ptrdiff_t n; /* The number of the next arg to substitute. */ char initial_buffer[4000]; @@ -4195,9 +4193,6 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, = bool message, /* The start and end bytepos in the output string. */ ptrdiff_t start, end; =20 - /* Whether the argument is a newly created string. */ - bool_bf new_string : 1; - /* Whether the argument is a string with intervals. */ bool_bf intervals : 1; } *info; @@ -4241,6 +4236,9 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, = bool message, ptrdiff_t ispec; ptrdiff_t nspec =3D 0; =20 + /* True if a string needs to be allocated to hold the result. */ + bool new_result =3D false; + /* If we start out planning a unibyte result, then discover it has to be multibyte, we jump back to retry. */ retry: @@ -4360,7 +4358,6 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, = bool message, if (nspec < ispec) { spec->argument =3D args[n]; - spec->new_string =3D false; spec->intervals =3D false; nspec =3D ispec; } @@ -4378,7 +4375,6 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, = bool message, { Lisp_Object noescape =3D conversion =3D=3D 'S' ? Qnil : Qt; spec->argument =3D arg =3D Fprin1_to_string (arg, noescape); - spec->new_string =3D true; if (STRING_MULTIBYTE (arg) && ! multibyte) { multibyte =3D true; @@ -4397,7 +4393,6 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, = bool message, goto retry; } spec->argument =3D arg =3D Fchar_to_string (arg); - spec->new_string =3D true; } =20 if (!EQ (arg, args[n])) @@ -4421,7 +4416,6 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, = bool message, if (conversion =3D=3D 's') { if (format =3D=3D end && format - format_start =3D=3D 2 - && (!new_result || spec->new_string) && ! string_intervals (args[0])) return arg; =20 diff --git a/src/lisp.h b/src/lisp.h index 0c3ca3ae06..c503082442 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3969,7 +3969,6 @@ extern _Noreturn void time_overflow (void); extern Lisp_Object make_buffer_string (ptrdiff_t, ptrdiff_t, bool); extern Lisp_Object make_buffer_string_both (ptrdiff_t, ptrdiff_t, ptrdif= f_t, ptrdiff_t, bool); -extern Lisp_Object styled_format (ptrdiff_t, Lisp_Object *, bool, bool); extern void init_editfns (bool); extern void syms_of_editfns (void); =20 diff --git a/src/xdisp.c b/src/xdisp.c index 86164eb9f6..141275f15a 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10194,7 +10194,7 @@ vadd_to_log (char const *format, va_list ap) for (ptrdiff_t i =3D 1; i <=3D nargs; i++) args[i] =3D va_arg (ap, Lisp_Object); Lisp_Object msg =3D Qnil; - msg =3D styled_format (nargs, args, true, false); + msg =3D Fformat_message (nargs, args); =20 ptrdiff_t len =3D SBYTES (msg) + 1; USE_SAFE_ALLOCA; @@ -19525,7 +19525,7 @@ DEFUN ("trace-to-stderr", Ftrace_to_stderr, Strac= e_to_stderr, 1, MANY, "", usage: (trace-to-stderr STRING &rest OBJECTS) */) (ptrdiff_t nargs, Lisp_Object *args) { - Lisp_Object s =3D styled_format (nargs, args, false, false); + Lisp_Object s =3D Fformat (nargs, args); fwrite (SDATA (s), 1, SBYTES (s), stderr); return Qnil; } --=20 2.13.5 From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 27 16:00:21 2017 Received: (at 28625) by debbugs.gnu.org; 27 Sep 2017 20:00:21 +0000 Received: from localhost ([127.0.0.1]:35423 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxIVI-0000ot-Ug for submit@debbugs.gnu.org; Wed, 27 Sep 2017 16:00:21 -0400 Received: from mail-pg0-f43.google.com ([74.125.83.43]:47547) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxIVG-0000of-TG for 28625@debbugs.gnu.org; Wed, 27 Sep 2017 16:00:19 -0400 Received: by mail-pg0-f43.google.com with SMTP id d8so8362146pgt.4 for <28625@debbugs.gnu.org>; Wed, 27 Sep 2017 13:00:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:date:message-id:references :user-agent:mime-version:content-transfer-encoding; bh=19RSJyXOcKxSZTRpJvfnNbhJ5oeWMjvyUoC+8nxV84M=; b=myFWXOl0DlsDTvJC1/arkGkyoB1KLqZlqWnf0wnDs9L/sAxKvx3oh4RmMlL9uGjI7L GfM3dmfI1laI2z60GMcUlupRYnbxY7KVguzVK3a/4n4Ewh6bp5/BlyEgPRqVplCYEEbL NY1sbAgFYre/zcbsZ+Nh9IqysTBdhVBp1olSvyhryHuT7sy7Ztu0obqHRt7Okl9r4M3e 6ZTfgokOXzwMCt3siycBjeIONJtELHi1k2KbunYnqo7UKckWTsgt/RZx8RHvgtXbSDlf qaMzvCyJnXoBpfas1q284opFWGYlcaH9qPn0ZULsUtPxMNK9zR6y9t0G4ZtuJ+2pgIST XleA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:date:message-id :references:user-agent:mime-version:content-transfer-encoding; bh=19RSJyXOcKxSZTRpJvfnNbhJ5oeWMjvyUoC+8nxV84M=; b=tq9Z33ApKXTqzOYV9UZrMm6t+nBU3GWEWFTV3Aj494wAJiP8NvN45LOuhuF/swBeuT e/cj9ksrS+BwpoJs4E1BbAy4hF/uuaND8MHvjjVQufZQt2e4zX+KeRYZZ5bYg99uNgyt k418jMlKcoLuLSEQEVxIIlOZwgkj5dDLyBqHdZQ1nvbkoe/g4BfXRpY/APF9UG1ORnfE VxrTQ8NuaPebz40juqyy522n7P9j3iVQKmAZm35zV2FvkLphD3WevQdaEbJt0RWMIXUz 2k8qaW+QJixIiU911z9tM8g7Sq0j4JKYmSpdWaB3O18d8nSYweLe5hKUBvd5tHS2U/tc PHWA== X-Gm-Message-State: AHPjjUgTKL2GdSkP9WYahdgjkO0ynDO36Tqc3aVuL7CACuyv/1ZJsfZX zwnnaKRMQStsdSkbntBgTtI= X-Google-Smtp-Source: AOwi7QDQpyt86Gzxl9s6JLuZ21lUttJrIhD2gGsVx3wh5G0czsCawyEK43/1nqjs/qqnU6UICdtebw== X-Received: by 10.84.129.65 with SMTP id 59mr2086715plb.442.1506542412930; Wed, 27 Sep 2017 13:00:12 -0700 (PDT) Received: from Vulcan.local (76-234-69-149.lightspeed.frokca.sbcglobal.net. [76.234.69.149]) by smtp.gmail.com with ESMTPSA id y1sm5680770pgp.15.2017.09.27.13.00.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Sep 2017 13:00:12 -0700 (PDT) From: John Wiegley X-Google-Original-From: "John Wiegley" Received: by Vulcan.local (Postfix, from userid 501) id 14F089364A54; Wed, 27 Sep 2017 13:00:11 -0700 (PDT) To: Paul Eggert Subject: Re: bug#28625: [PROPOSED] Speed up (format "%s" STRING) and the like In-Reply-To: <20170927185212.1846-1-eggert@cs.ucla.edu> (Paul Eggert's message of "Wed, 27 Sep 2017 11:52:12 -0700") Date: Wed, 27 Sep 2017 13:00:08 -0700 Message-ID: References: <20170927185212.1846-1-eggert@cs.ucla.edu> User-Agent: Gnus/5.130016 (Ma Gnus v0.16) Emacs/26.0 (darwin) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: 28625 Cc: 28625@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.8 (--) >>>>> "PE" =3D=3D Paul Eggert writes: PE> Although the Lisp manual said that =E2=80=98format=E2=80=99 returns a n= ewly-allocated PE> string, this was not true for a few cases like (format "%s" ""), and PE> fixing the documentation to allow reuse of arguments lets us improve PE> performance in common cases like (format "foo") and (format "%s" "foo"). Is the performance gain worth the change? --=20 John Wiegley GPG fingerprint =3D 4710 CF98 AF9B 327B B80F http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2 From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 27 16:12:00 2017 Received: (at 28625) by debbugs.gnu.org; 27 Sep 2017 20:12:00 +0000 Received: from localhost ([127.0.0.1]:35436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxIga-00014l-AS for submit@debbugs.gnu.org; Wed, 27 Sep 2017 16:12:00 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:47946) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxIgX-00014V-2T for 28625@debbugs.gnu.org; Wed, 27 Sep 2017 16:11:58 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 3494E160D98; Wed, 27 Sep 2017 13:11:50 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id h-cX_UoopkBt; Wed, 27 Sep 2017 13:11:49 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 637E4160E31; Wed, 27 Sep 2017 13:11:49 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 8TYp6n8SOcnp; Wed, 27 Sep 2017 13:11:49 -0700 (PDT) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 4C899160D98; Wed, 27 Sep 2017 13:11:49 -0700 (PDT) Subject: Re: bug#28625: [PROPOSED] Speed up (format "%s" STRING) and the like To: John Wiegley References: <20170927185212.1846-1-eggert@cs.ucla.edu> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <857ceb29-1ffc-6218-f756-a0bb9c3aa334@cs.ucla.edu> Date: Wed, 27 Sep 2017 13:11:48 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 28625 Cc: 28625@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) On 09/27/2017 01:00 PM, John Wiegley wrote: > Is the performance gain worth the change? It is for applications that heavily use 'format' with the optimized cases. For example, on my old desktop (AMD Phenom II X4 910e), the proposed patch speeds up the microbenchmark (format "%s" "Hello, world!") by a factor of 9. It also causes Emacs to use less RAM, though this is harder to measure. Also, the change simplifies the Emacs source code, and that's a win even if the performance gain is small. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 27 17:33:30 2017 Received: (at 28625) by debbugs.gnu.org; 27 Sep 2017 21:33:30 +0000 Received: from localhost ([127.0.0.1]:35512 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxJxR-0004wo-Vd for submit@debbugs.gnu.org; Wed, 27 Sep 2017 17:33:30 -0400 Received: from mail-pg0-f48.google.com ([74.125.83.48]:47759) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxJxQ-0004wb-CD for 28625@debbugs.gnu.org; Wed, 27 Sep 2017 17:33:28 -0400 Received: by mail-pg0-f48.google.com with SMTP id d8so8481467pgt.4 for <28625@debbugs.gnu.org>; Wed, 27 Sep 2017 14:33:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:date:message-id:references :user-agent:mime-version; bh=V8zGb3cKphT7Zpjp0BIwQ7E6EcWp0+r0Ek2HiuNmzuA=; b=PIWeOyDdQDhqgUsyU1c8uPCqR6cmzR9WhltjN5WPhH2DOONaK7/XLBMUlbjPCxqWW8 xJvsZ4L6CTH09l0sDrFdK2cm8Kkuu/VO8uBW1oD3XVcfTc8hzmsNoysM1ZzeMx3TH7Bp KVYzJkKEOulRfvw+RX6Ly2gqPhPhC+yPAoPt0ofyMecTmQdrZuHQHhM3UMGX0HjDvMm+ I0p6yVECli2F3L6rclEOB76HXGyZ0cPdOYVjBmJxIvr0uJYq2CuD4ONqGjyzASW2Wmjs wUJrXQ29tHgQQAbbTUkXV45dYjjCErVNtvIeiDpF2GJBaXKe+CdoUYdR6j7ewpBNcdFD m8oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:date:message-id :references:user-agent:mime-version; bh=V8zGb3cKphT7Zpjp0BIwQ7E6EcWp0+r0Ek2HiuNmzuA=; b=ixk1nWisB1Bnybj/DSyGyrhMQ4R8M97kQkwnhNe2p3SbJifgkV9Cr6xa4ouXlX8zpn Iy/Dg1q46XThWeZdBCZwc+RTVnPaAYwr17b5J/1SjDLa1BOXja80Jc3yrPyl2BVO45ef TXFr2vX6fFgDzzChA5A6hNNGsiwYmaNWZ202nj4yLBWf4QCH4OKui/oumgoI/PkWkrIs Yz7k/dutz0368jSg00pAHIQ0zEeljmXr0V5+FtFTiyO9O/1jVGcSkh3kiNcZKvW+8mos B2J2gArYUOW+ga5DhmNrg4Z+sXOIoj2g+5XzwFK3lc4YxulpSmwFUVpAjtJMKwXozDx9 jGig== X-Gm-Message-State: AHPjjUggSG6oQ5wREV5fPCXk/XEM1lpqtf8CsSrq9ex9x1tpte0P/Wqu 9qfLUfWSPX63jqNFtrUGdvw= X-Google-Smtp-Source: AOwi7QBpRp4lLg4jg7jKqnWhJ2mU3O/B9ynTaj2kj7JuHYlABzm8m5DkpYQvy3dl0zwwuFfPWb6BUg== X-Received: by 10.99.121.77 with SMTP id u74mr2390512pgc.81.1506548002498; Wed, 27 Sep 2017 14:33:22 -0700 (PDT) Received: from Vulcan.local (76-234-69-149.lightspeed.frokca.sbcglobal.net. [76.234.69.149]) by smtp.gmail.com with ESMTPSA id k25sm19660947pgf.13.2017.09.27.14.33.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Sep 2017 14:33:21 -0700 (PDT) From: John Wiegley X-Google-Original-From: "John Wiegley" Received: by Vulcan.local (Postfix, from userid 501) id 8E08693805F5; Wed, 27 Sep 2017 14:33:20 -0700 (PDT) To: Paul Eggert Subject: Re: bug#28625: [PROPOSED] Speed up (format "%s" STRING) and the like In-Reply-To: <857ceb29-1ffc-6218-f756-a0bb9c3aa334@cs.ucla.edu> (Paul Eggert's message of "Wed, 27 Sep 2017 13:11:48 -0700") Date: Wed, 27 Sep 2017 14:33:19 -0700 Message-ID: References: <20170927185212.1846-1-eggert@cs.ucla.edu> <857ceb29-1ffc-6218-f756-a0bb9c3aa334@cs.ucla.edu> User-Agent: Gnus/5.130016 (Ma Gnus v0.16) Emacs/26.0 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: 28625 Cc: 28625@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.8 (--) >>>>> Paul Eggert writes: > Also, the change simplifies the Emacs source code, and that's a win even if > the performance gain is small. Can you enable ELP for just 'format', use Emacs for a few hours as you normally do, and then report how many times, and how much time, is consumed in its use? I'm not really interested in benchmarks that stress format. If the time advantage is lost in the background noise, I don't think it's worth changing. -- John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2 From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 27 19:33:33 2017 Received: (at 28625) by debbugs.gnu.org; 27 Sep 2017 23:33:33 +0000 Received: from localhost ([127.0.0.1]:35627 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxLpd-0001Ck-JA for submit@debbugs.gnu.org; Wed, 27 Sep 2017 19:33:33 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:49746) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxLpb-0001CV-Gf for 28625@debbugs.gnu.org; Wed, 27 Sep 2017 19:33:32 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 918FE160E01; Wed, 27 Sep 2017 16:33:25 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 9MqZUqBQbl4Q; Wed, 27 Sep 2017 16:33:24 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id E22DD160E04; Wed, 27 Sep 2017 16:33:24 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id YpBTLRqdzzcM; Wed, 27 Sep 2017 16:33:24 -0700 (PDT) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id C8DA9160E01; Wed, 27 Sep 2017 16:33:24 -0700 (PDT) Subject: Re: bug#28625: [PROPOSED] Speed up (format "%s" STRING) and the like To: John Wiegley References: <20170927185212.1846-1-eggert@cs.ucla.edu> <857ceb29-1ffc-6218-f756-a0bb9c3aa334@cs.ucla.edu> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <3fe5e3e1-d027-dd48-9d79-a9e64774a1c6@cs.ucla.edu> Date: Wed, 27 Sep 2017 16:33:24 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 28625 Cc: 28625@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) On 09/27/2017 02:33 PM, John Wiegley wrote: > Can you enable ELP for just 'format', use Emacs for a few hours as you > normally do, and then report how many times, and how much time, is consumed in > its use? I am not the best person to try that, as I typically don't use Emacs for hours at a time and am not really a power user in the traditional sense. Furthermore, counting all calls isn't what is wanted here: we want to count just calls that copy strings unnecessarily. I take your point that the patch is only a minor performance improvement in the big picture. And although the patch does simplify the Emacs source code, that's minor too. (Should I propose only major changes from now on? :-) From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 27 21:47:39 2017 Received: (at 28625) by debbugs.gnu.org; 28 Sep 2017 01:47:39 +0000 Received: from localhost ([127.0.0.1]:35694 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxNvP-0004Bq-II for submit@debbugs.gnu.org; Wed, 27 Sep 2017 21:47:39 -0400 Received: from mail-io0-f179.google.com ([209.85.223.179]:47785) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxNvN-0004Bc-Ev for 28625@debbugs.gnu.org; Wed, 27 Sep 2017 21:47:37 -0400 Received: by mail-io0-f179.google.com with SMTP id e189so322832ioa.4 for <28625@debbugs.gnu.org>; Wed, 27 Sep 2017 18:47:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=+3f/25oXkO3wMktLDPoLv/TmljAGbmIDANi5in4ehS4=; b=Yk6l7Uu1lPPF0dkVCVvUvzzdDuKsgqzJmUZFpRDfxQRE7nRcBB6KWQ1xUOech5s7xe chfD0Z0oFAz3wZQXX3T1MqBTGemOfVVq6+raxVlIcLl1Qih8CkXlXCr4NbN1A5yjaoPV FKL/C9zj36lrntQApmvN5nYMpgNTUKtR97wD/i7+B9RGvLT4OwNuvfcDdSjeryw3kVda jVnal0zljOrzV2QFPZ7QlKforL6Ek+3Ki+kgWwpwX/TsIlwwVnZm4BIV0w2iTUXYWche fONp7Kv7SBYtLtIhk4CvADCEy+JaF+8NwrUu3uvfeOF0RbnozmQIeb04oTmRMtEz4cN9 /Z4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=+3f/25oXkO3wMktLDPoLv/TmljAGbmIDANi5in4ehS4=; b=LV6EcfCrEBekTcjeqXEz7ASIPvbwhWue+71aJNVzrlPVanwGVrVXnvFkAO7P0oi4EP 2gWpDm00TrDG+AbC++dtUTp8iXLcl0R0Eo1VK+vRJp002s7BJumo4mMNR1YaHPkhSRAr XoOJg5T5NNstrxew/30YpBAPYcb/4ylsX4mbUwzgMlrbpCkNC7bUgfZbYxJUvbZeQcnV ZQBO5YTa70i/4uNCgch/xhDr5Ymaypyd1pPkGNPJ+ZOKb0m4/BUuS7lYw6oqRnxeQY8I s9HtlNSwBv3+Hp7rdYsCQRx9YNybWdDOWQqrrmTYh5FSYL4KYvQoxfLBMJq9Am1FOuMG b9fA== X-Gm-Message-State: AMCzsaWwaX2w6v88eBZUzhxdVEGHovSE42+QN0k2XUJ5It8CQi1zw7nL frR7woszrkah4IbIakv01JAPUw== X-Google-Smtp-Source: AOwi7QC707capz031/TV8to+fdgo0VGqBQr5aS/qJIITToBdO85O0HAcYoEsN+yxDRGnJM/pNd0Jig== X-Received: by 10.107.81.10 with SMTP id f10mr4783768iob.22.1506563251606; Wed, 27 Sep 2017 18:47:31 -0700 (PDT) Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id k188sm370198itd.34.2017.09.27.18.47.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Sep 2017 18:47:30 -0700 (PDT) From: Noam Postavsky To: Paul Eggert Subject: Re: bug#28625: [PROPOSED] Speed up (format "%s" STRING) and the like References: <20170927185212.1846-1-eggert@cs.ucla.edu> <857ceb29-1ffc-6218-f756-a0bb9c3aa334@cs.ucla.edu> Date: Wed, 27 Sep 2017 21:47:29 -0400 In-Reply-To: <857ceb29-1ffc-6218-f756-a0bb9c3aa334@cs.ucla.edu> (Paul Eggert's message of "Wed, 27 Sep 2017 13:11:48 -0700") Message-ID: <87k20jfvbi.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 28625 Cc: 28625@debbugs.gnu.org, John Wiegley X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Paul Eggert writes: > Also, the change simplifies the Emacs source code, and that's a win > even if the performance gain is small. I kind of rolled my eyes a bit when I saw the subject, as optimizing `format' hardly seems like a priority; but IMO, the patch is indeed worthwhile for the code simplication. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 28 01:40:40 2017 Received: (at 28625) by debbugs.gnu.org; 28 Sep 2017 05:40:40 +0000 Received: from localhost ([127.0.0.1]:35791 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxRYu-000191-Ad for submit@debbugs.gnu.org; Thu, 28 Sep 2017 01:40:40 -0400 Received: from mail-pg0-f46.google.com ([74.125.83.46]:55704) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxRYs-00018o-0D for 28625@debbugs.gnu.org; Thu, 28 Sep 2017 01:40:38 -0400 Received: by mail-pg0-f46.google.com with SMTP id b11so340642pgn.12 for <28625@debbugs.gnu.org>; Wed, 27 Sep 2017 22:40:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:date:message-id:references :user-agent:mime-version; bh=cmaq33R69Rm6WCQmuhrxQJjHVsEgYByHETIfsd/yI8o=; b=TTVpkpRN31JAGpaMkZcY1RzjKfghNKZ1rTdLwsgJ+u04pv3NNSZW2VPjKd7YvVrOlA HGZQjw8n+fm2w4VMOIAMktdPbboRQLl806/Bxy+qOHyBZdZ+/4HBCXiDQNyHWSGosZGR ly2OXrLS6reLyC3vTQu2o/DzYz/NLE5WlknkaZv7uSVbEtPf/RZJYm/blnNoWVIJjUS4 aX6kqER4rNOOAxxJTCp4mRLv+IP2ZVI01bVxlQ58BN/1RSeLhk6aDQvGWXJvzNCjkVCz vYhC3bEEnDaeGST87XuILsXxQW70hhJCJDCf9vwSMb3EQgVIwxmk0xC9SlGFFi9vT+wE PtIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:date:message-id :references:user-agent:mime-version; bh=cmaq33R69Rm6WCQmuhrxQJjHVsEgYByHETIfsd/yI8o=; b=RiAIGJQARcWOhnxN4LR9K0+7LCPbp6P14fVKjn1AosBuosk8m7nb6PsM68cWN2wN7B b9YEywYcq8qIDdsWDLw/Sr5/7GdJvj6oVfggySLSwRFaV+VQGgJMqsXw4v6YJs7VJ+Vt r90Bhpp7Ihg92ebPWkzPr1Tal7c9b8BNxruCmcAPxmMgThiLd2vWQaE5UOl2AxATDkDs 8Lv8Is4GahY1eAM8sFb2ybtRxmzZ9/KFOXboZM83DSm8zz7BjnEVLsJtcPdbGnTeubL1 DrpeIGsQbD7leWFdPEpLwizjG5bf34RaVumil9vEKouI3fwBNPYorz95aU351QY+vQ+y IELA== X-Gm-Message-State: AHPjjUhHynYhMe/XF/shNY/XrCYhjMkPIMEqkbVcDjDVXnqYZAasfvNN P1MEzgALPwp7YR1JyWZAhHI= X-Google-Smtp-Source: AOwi7QBwX8ksDu/WlmEkE0knissWTekgqldWcGe45LxfVzXLQ9rVm3vxz54a7gmTj8UWjG+cj1qT6Q== X-Received: by 10.101.66.135 with SMTP id j7mr1173762pgp.121.1506577231998; Wed, 27 Sep 2017 22:40:31 -0700 (PDT) Received: from Vulcan.local (76-234-69-149.lightspeed.frokca.sbcglobal.net. [76.234.69.149]) by smtp.gmail.com with ESMTPSA id d5sm1116810pfg.26.2017.09.27.22.40.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Sep 2017 22:40:31 -0700 (PDT) From: John Wiegley X-Google-Original-From: "John Wiegley" Received: by Vulcan.local (Postfix, from userid 501) id 7F86393D824D; Wed, 27 Sep 2017 22:40:30 -0700 (PDT) To: Paul Eggert Subject: Re: bug#28625: [PROPOSED] Speed up (format "%s" STRING) and the like In-Reply-To: <3fe5e3e1-d027-dd48-9d79-a9e64774a1c6@cs.ucla.edu> (Paul Eggert's message of "Wed, 27 Sep 2017 16:33:24 -0700") Date: Wed, 27 Sep 2017 22:40:22 -0700 Message-ID: References: <20170927185212.1846-1-eggert@cs.ucla.edu> <857ceb29-1ffc-6218-f756-a0bb9c3aa334@cs.ucla.edu> <3fe5e3e1-d027-dd48-9d79-a9e64774a1c6@cs.ucla.edu> User-Agent: Gnus/5.130016 (Ma Gnus v0.16) Emacs/26.0 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 28625 Cc: 28625@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) >>>>> Paul Eggert writes: > I take your point that the patch is only a minor performance improvement in > the big picture. And although the patch does simplify the Emacs source code, > that's minor too. (Should I propose only major changes from now on? :-) I do appreciate the simplication, although if semantics have changed at all, I'm against without a bigger win. -- John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2 From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 29 11:49:12 2017 Received: (at 28625) by debbugs.gnu.org; 29 Sep 2017 15:49:12 +0000 Received: from localhost ([127.0.0.1]:39420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxxXL-00018C-Oq for submit@debbugs.gnu.org; Fri, 29 Sep 2017 11:49:11 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39884) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxxXK-00017z-2p for 28625@debbugs.gnu.org; Fri, 29 Sep 2017 11:49:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dxxX9-0005Uv-VL for 28625@debbugs.gnu.org; Fri, 29 Sep 2017 11:49:04 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47334) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxxX9-0005Uj-RI; Fri, 29 Sep 2017 11:48:59 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1320 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dxxX9-0004X6-9s; Fri, 29 Sep 2017 11:48:59 -0400 Date: Fri, 29 Sep 2017 18:48:51 +0300 Message-Id: <83tvzl7bfg.fsf@gnu.org> From: Eli Zaretskii To: Paul Eggert In-reply-to: <20170927185212.1846-1-eggert@cs.ucla.edu> (message from Paul Eggert on Wed, 27 Sep 2017 11:52:12 -0700) Subject: Re: bug#28625: [PROPOSED] Speed up (format "%s" STRING) and the like References: <20170927185212.1846-1-eggert@cs.ucla.edu> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28625 Cc: 28625@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Paul Eggert > Date: Wed, 27 Sep 2017 11:52:12 -0700 > Cc: Paul Eggert > > 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. From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 04 17:45:53 2017 Received: (at 28625-done) by debbugs.gnu.org; 4 Oct 2017 21:45:53 +0000 Received: from localhost ([127.0.0.1]:49422 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzrUH-0007ok-JX for submit@debbugs.gnu.org; Wed, 04 Oct 2017 17:45:53 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:58194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzrUF-0007oV-VA for 28625-done@debbugs.gnu.org; Wed, 04 Oct 2017 17:45:52 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id D9AD3160E21; Wed, 4 Oct 2017 14:45:45 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id oQv_1tk3VCti; Wed, 4 Oct 2017 14:45:45 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 40FA7160E29; Wed, 4 Oct 2017 14:45:45 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id o2KTqmvlZ7Ct; Wed, 4 Oct 2017 14:45:45 -0700 (PDT) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 2816C160E21; Wed, 4 Oct 2017 14:45:45 -0700 (PDT) Subject: Re: bug#28625: [PROPOSED] Speed up (format "%s" STRING) and the like To: Eli Zaretskii References: <20170927185212.1846-1-eggert@cs.ucla.edu> <83tvzl7bfg.fsf@gnu.org> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <2bb1928b-1477-f1f5-73c4-8d635c80c399@cs.ucla.edu> Date: Wed, 4 Oct 2017 14:45:45 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <83tvzl7bfg.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 28625-done Cc: 28625-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) On 09/29/2017 08:48 AM, Eli Zaretskii wrote: > Fine with me for the release branch. Thanks, no further comment so I installed it and am closing this bug report. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 07 05:12:36 2017 Received: (at 28625) by debbugs.gnu.org; 7 Oct 2017 09:12:36 +0000 Received: from localhost ([127.0.0.1]:53753 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e0l9u-0000Dq-RV for submit@debbugs.gnu.org; Sat, 07 Oct 2017 05:12:36 -0400 Received: from mail-oi0-f47.google.com ([209.85.218.47]:44650) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e0l9s-0000Da-Pb for 28625@debbugs.gnu.org; Sat, 07 Oct 2017 05:12:33 -0400 Received: by mail-oi0-f47.google.com with SMTP id v132so13612429oie.1 for <28625@debbugs.gnu.org>; Sat, 07 Oct 2017 02:12:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KpzdRCAeRqU/UWM4bVwZVsiyziRPDkB6wUUUk9i6Gtw=; b=oaB2zLaeO2FphY0vL41tEwCP/NLYGrVhB2xJszl9B4BjEcdtn080BpY+lZQn6gk+Tr N/il1PA4OZrJh5F0OviAptxPN/oAl+OQW/r71YkUlu2+SGo4zyO5F4vlpZ9L5Ogo8sEH hZQrzd5Sqi5Taji5fzc1RmqloPK8Kz6u2H6IatOK/PiwZlb0wvKXxAZHC+D06Ay0lb9T nTCD85V08dCotsPjd5G8WEhy+OLRLHO1JXiuW5Ri33+u2jqXXxuY7JGkrnbF1QvKrPRT xIaY1U/rqh8yNkg0RlmtPZkGQ1READ3QQZ+Nm5E/qjRKICTlvhgjfm3YnDtZLAS2I6fY 9TMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KpzdRCAeRqU/UWM4bVwZVsiyziRPDkB6wUUUk9i6Gtw=; b=PyWZYJcpAXqlyhtSP1Qh7qGPM/RdTSjOMgkOCrdGjXFL8D4uaEhhOeDT2rgDGNK16Q vg9WllgR6QhPTFU4W0oaYCkhW8MwvcA3bu9yTU7Y838tl1sSTue3AA/gLjKHvsIDGvSK wNZV0u7z0ZNlvm+cOJ0yXtcbS7J0h+7mCO2EHH2BHSAP3Fb2I1a5Qaq9slfsIz9gNUK/ gkenB1zzUmwabjZ/BxDytSHgm3OzduVmmeHwXs5s3jRaSZBrwrkRo92WDTqr7zTdB/qC naE1ZvFoU36ZH2lP1McXVcwsQ3rJpxzIVpYUafeUUPf0I0Re4OTC7SY4Uu9uaO2GrgBQ NJAQ== X-Gm-Message-State: AMCzsaXVxRmLX2l57/rvlnc8J8rXgfIAMW4RZEe3i5SDBN5sOo4pGr2q wV5EXjNeRcUVj6oMI/L7YLoDV5xL+1vYk28s/C8= X-Google-Smtp-Source: AOwi7QDuFRqSKMdgfOAouvBiesFH8BGrFmQuaAbJaV2ziWhgQhSj69M7/qGp4KA7wB2YF/slkkljAzbpKEtBzLU4OBw= X-Received: by 10.157.41.36 with SMTP id d33mr2877418otb.61.1507367547184; Sat, 07 Oct 2017 02:12:27 -0700 (PDT) MIME-Version: 1.0 References: <20170927185212.1846-1-eggert@cs.ucla.edu> <857ceb29-1ffc-6218-f756-a0bb9c3aa334@cs.ucla.edu> <3fe5e3e1-d027-dd48-9d79-a9e64774a1c6@cs.ucla.edu> In-Reply-To: From: Philipp Stephani Date: Sat, 07 Oct 2017 09:12:16 +0000 Message-ID: Subject: Re: bug#28625: [PROPOSED] Speed up (format "%s" STRING) and the like To: John Wiegley , Paul Eggert Content-Type: multipart/alternative; boundary="94eb2c04faa2322f11055af15b4e" X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 28625 Cc: 28625@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.0 (--) --94eb2c04faa2322f11055af15b4e Content-Type: text/plain; charset="UTF-8" John Wiegley schrieb am Do., 28. Sep. 2017 um 07:41 Uhr: > >>>>> Paul Eggert writes: > > > I take your point that the patch is only a minor performance improvement > in > > the big picture. And although the patch does simplify the Emacs source > code, > > that's minor too. (Should I propose only major changes from now on? :-) > > I do appreciate the simplication, although if semantics have changed at > all, > I'm against without a bigger win. > Shouldn't this at least be documented in the "Incompatible Lisp changes" section of NEWS? --94eb2c04faa2322f11055af15b4e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


John W= iegley <jwiegley@gmail.com>= schrieb am Do., 28. Sep. 2017 um 07:41=C2=A0Uhr:
>>>>> Paul Eggert <eggert@cs.ucla.edu> writes:

> I take your point that the patch is only a minor performance improveme= nt in
> the big picture. And although the patch does simplify the Emacs source= code,
> that's minor too. (Should I propose only major changes from now on= ? :-)

I do appreciate the simplication, although if semantics have changed at all= ,
I'm against without a bigger win.

Shouldn't this at least be documented = in the "Incompatible Lisp changes" section of NEWS?=C2=A0
--94eb2c04faa2322f11055af15b4e-- From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 07 05:49:11 2017 Received: (at 28625) by debbugs.gnu.org; 7 Oct 2017 09:49:11 +0000 Received: from localhost ([127.0.0.1]:53773 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e0ljK-0001C8-WD for submit@debbugs.gnu.org; Sat, 07 Oct 2017 05:49:11 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60273) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e0ljI-0001Bq-98 for 28625@debbugs.gnu.org; Sat, 07 Oct 2017 05:49:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0lj8-0008JU-4t for 28625@debbugs.gnu.org; Sat, 07 Oct 2017 05:49:03 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44987) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0lj8-0008JO-1G; Sat, 07 Oct 2017 05:48:58 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2307 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e0lj7-0002b9-6j; Sat, 07 Oct 2017 05:48:57 -0400 Date: Sat, 07 Oct 2017 12:48:51 +0300 Message-Id: <83wp47thj0.fsf@gnu.org> From: Eli Zaretskii To: Philipp Stephani In-reply-to: (message from Philipp Stephani on Sat, 07 Oct 2017 09:12:16 +0000) Subject: Re: bug#28625: [PROPOSED] Speed up (format "%s" STRING) and the like References: <20170927185212.1846-1-eggert@cs.ucla.edu> <857ceb29-1ffc-6218-f756-a0bb9c3aa334@cs.ucla.edu> <3fe5e3e1-d027-dd48-9d79-a9e64774a1c6@cs.ucla.edu> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28625 Cc: 28625@debbugs.gnu.org, jwiegley@gmail.com, eggert@cs.ucla.edu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Philipp Stephani > Date: Sat, 07 Oct 2017 09:12:16 +0000 > Cc: 28625@debbugs.gnu.org > > Shouldn't this at least be documented in the "Incompatible Lisp changes" section of NEWS? If it's incompatible, sure. Is it? Can you show the effect of the incompatibility? From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 07 06:57:12 2017 Received: (at 28625) by debbugs.gnu.org; 7 Oct 2017 10:57:12 +0000 Received: from localhost ([127.0.0.1]:53787 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e0mn9-0002xS-DA for submit@debbugs.gnu.org; Sat, 07 Oct 2017 06:57:11 -0400 Received: from mail-oi0-f41.google.com ([209.85.218.41]:55420) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e0mn7-0002xF-OE for 28625@debbugs.gnu.org; Sat, 07 Oct 2017 06:57:10 -0400 Received: by mail-oi0-f41.google.com with SMTP id g125so15690692oib.12 for <28625@debbugs.gnu.org>; Sat, 07 Oct 2017 03:57:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DJyWsHkKlm+IZzZFWteblKuOSaTfneoLAqUsCtaxRDM=; b=GgwsL2ZFfLkzAcJRnds9diE8yIukdcOYjtATuf6puLqvTDg0nDFWhuLzLZo9xNyvDB muYCsNwnstqlR5c+9ugUu/i41Pw26OMs0UKKHAOHmt/OCGONts/nejRRITM6rNkjaqaG ab7D0XSkVLbveDHn1yT24ZQ3ZM7uffIWFAmQeaTrnpfETtZo/nHnSl7fsdeF3SRtm2q9 grTF4IfysfVAVJKCx96QrB4ajJKgoMlFdx4l/bdRCih9MhJ/J+s6vyFUKYPYBNsl7V7q OyluqpVujBmRUA5QYiZb02wsQf9m9fWgBr1U3IVdA01rF7TEz1MFBzC2z4ZXjYD2rvG4 sJEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DJyWsHkKlm+IZzZFWteblKuOSaTfneoLAqUsCtaxRDM=; b=LgwDrbdf0/siDPU7niE3oF97EJkP7NeEFPZe4xsfqxByZ/Y7tgI+NMUlgVgxD8x3Db 113O2U/onpHKUF9rpFYHQzh/ydrZBfGVR6dXaqcOcrxt/qaZU6KGrSQXvcvXzeE7rgKF If0BTq6dfLO/V5LGVKrvtAqAZzDcZWvpktj7JYWpdEIFHjXDwc2Gs/d5ZYADq8tSl1Tc RhxDjvko0S3X6c89+M9kDRkQg5HbG3dHVtdDFclQ7hPC7mrH1v9yYC8n5y16NzHtH8Nv ZcMThCDsGoSKYszVnr+rUGdm8pjN6PrvQKFNiF+C5CgIji5kIL5EPOpTHLxfyuhEqV6Z U14A== X-Gm-Message-State: AMCzsaXVeC5xOiK4M391hg8tZjqO5x86RGM/tSP0rXfyn3AgMWF+ilAl j65JuiOCI3EDhZgU+ULvXezqg7vteShNDkS+qVY= X-Google-Smtp-Source: AOwi7QBdEo+4a0EyrIr2Njc0BscsFRoGTcX+ZHeLbhU0Bxz4FCf4XoUAANZwF3YstmQRaMffSeng8uGfvVNEPARY8g4= X-Received: by 10.157.66.43 with SMTP id q43mr3061876ote.219.1507373823766; Sat, 07 Oct 2017 03:57:03 -0700 (PDT) MIME-Version: 1.0 References: <20170927185212.1846-1-eggert@cs.ucla.edu> <857ceb29-1ffc-6218-f756-a0bb9c3aa334@cs.ucla.edu> <3fe5e3e1-d027-dd48-9d79-a9e64774a1c6@cs.ucla.edu> <83wp47thj0.fsf@gnu.org> In-Reply-To: <83wp47thj0.fsf@gnu.org> From: Philipp Stephani Date: Sat, 07 Oct 2017 10:56:52 +0000 Message-ID: Subject: Re: bug#28625: [PROPOSED] Speed up (format "%s" STRING) and the like To: Eli Zaretskii Content-Type: multipart/alternative; boundary="f403043788c04f38ee055af2d19c" X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 28625 Cc: 28625@debbugs.gnu.org, jwiegley@gmail.com, eggert@cs.ucla.edu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) --f403043788c04f38ee055af2d19c Content-Type: text/plain; charset="UTF-8" Eli Zaretskii schrieb am Sa., 7. Okt. 2017 um 11:49 Uhr: > > From: Philipp Stephani > > Date: Sat, 07 Oct 2017 09:12:16 +0000 > > Cc: 28625@debbugs.gnu.org > > > > Shouldn't this at least be documented in the "Incompatible Lisp changes" > section of NEWS? > > If it's incompatible, sure. Is it? Can you show the effect of the > incompatibility? > $ emacs -Q -batch -eval '(let* ((a "a") (b (format "%s" a))) (aset a 0 ?b) (print b))' With Emacs 25.3 this prints "a", with current master it prints "b". --f403043788c04f38ee055af2d19c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Eli Za= retskii <eliz@gnu.org> schrieb am= Sa., 7. Okt. 2017 um 11:49=C2=A0Uhr:
> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Sat, 07 Oct 2017 09:12:16 +0000
> Cc: 28625@d= ebbugs.gnu.org
>
> Shouldn't this at least be documented in the "Incompatible Li= sp changes" section of NEWS?

If it's incompatible, sure.=C2=A0 Is it?=C2=A0 Can you show the effect = of the
incompatibility?

$ emacs -Q -batch -eva= l '(let* ((a "a") (b (format "%s" a))) (aset a 0 ?b= ) (print b))'

With Emacs 25.3 this prints &quo= t;a", with current master it prints "b".=C2=A0
--f403043788c04f38ee055af2d19c-- From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 07 07:34:43 2017 Received: (at 28625) by debbugs.gnu.org; 7 Oct 2017 11:34:43 +0000 Received: from localhost ([127.0.0.1]:53795 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e0nNT-0005qP-8v for submit@debbugs.gnu.org; Sat, 07 Oct 2017 07:34:43 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50982) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e0nNR-0005qC-Qi for 28625@debbugs.gnu.org; Sat, 07 Oct 2017 07:34:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0nNJ-0006nl-LC for 28625@debbugs.gnu.org; Sat, 07 Oct 2017 07:34:36 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45883) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0nNJ-0006nh-IB; Sat, 07 Oct 2017 07:34:33 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2528 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e0nNI-0006K8-UC; Sat, 07 Oct 2017 07:34:33 -0400 Date: Sat, 07 Oct 2017 14:34:27 +0300 Message-Id: <83shevtcn0.fsf@gnu.org> From: Eli Zaretskii To: Philipp Stephani In-reply-to: (message from Philipp Stephani on Sat, 07 Oct 2017 10:56:52 +0000) Subject: Re: bug#28625: [PROPOSED] Speed up (format "%s" STRING) and the like References: <20170927185212.1846-1-eggert@cs.ucla.edu> <857ceb29-1ffc-6218-f756-a0bb9c3aa334@cs.ucla.edu> <3fe5e3e1-d027-dd48-9d79-a9e64774a1c6@cs.ucla.edu> <83wp47thj0.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28625 Cc: 28625@debbugs.gnu.org, jwiegley@gmail.com, eggert@cs.ucla.edu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Philipp Stephani > Date: Sat, 07 Oct 2017 10:56:52 +0000 > Cc: jwiegley@gmail.com, eggert@cs.ucla.edu, 28625@debbugs.gnu.org > > > Shouldn't this at least be documented in the "Incompatible Lisp changes" section of NEWS? > > If it's incompatible, sure. Is it? Can you show the effect of the > incompatibility? > > $ emacs -Q -batch -eval '(let* ((a "a") (b (format "%s" a))) (aset a 0 ?b) (print b))' > > With Emacs 25.3 this prints "a", with current master it prints "b". You could see the same behavior with earlier versions when the string was empty, so we just expanded this behavior, not really changed it. However, I see your point, so I moved the entry into the Incompatible Lisp Changes section. From unknown Thu Aug 14 12:26:06 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 05 Nov 2017 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator