all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Emacs development discussions <emacs-devel@gnu.org>
Subject: Speeding up (format "%s" STRING)
Date: Wed, 27 Sep 2017 13:13:51 -0700	[thread overview]
Message-ID: <16bcf8f3-62b7-b98e-5ac0-d6133fe2cf1d@cs.ucla.edu> (raw)

In Bug#28625 I propose changing the documentation for the 'format' 
function so that it no longer states that 'format' returns a 
newly-allocated string. This statement is already incorrect for cases 
like (format "%s" ""), and removing the statement lets us improve the 
performance for other cases such as (format "foo") and (format "%s" 
"foo"). Although I doubt whether any code depends on 'format' always 
returning a newly-allocated string for these cases, the proposed patch 
does change the semantics of 'format' slightly, so I'm sending this 
heads-up to emacs-devel to ask if anyone sees problems with it.

As noted in Bug#28625, on my old desktop (AMD Phenom II X4 910e), the 
proposed patch speeds up (format "%s" "Hello, world!") by a factor of 
about 9. It also causes Emacs to use less RAM (harder to measure) and 
simplifies the Emacs source code.




                 reply	other threads:[~2017-09-27 20:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16bcf8f3-62b7-b98e-5ac0-d6133fe2cf1d@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.