unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: Dmitry Antipov <dmantipov@yandex.ru>,
	Emacs Development <Emacs-devel@gnu.org>
Subject: Re: inline build_string performance
Date: Tue, 26 Jun 2012 17:17:31 +0200	[thread overview]
Message-ID: <m28vfap0fo.fsf@igel.home> (raw)
In-Reply-To: <4FE9CCFF.2060309@cs.ucla.edu> (Paul Eggert's message of "Tue, 26 Jun 2012 07:53:51 -0700")

Paul Eggert <eggert@cs.ucla.edu> writes:

> Trunk bzr 108742 changed build_string from a standard
> extern function to a static inline function:
>
> static inline Lisp_Object
> build_string (const char *str)
> {
>   return make_string (str, strlen (str));
> }
>
> This is not an unalloyed win, since it bloats the
> size of the Emacs executable, as callers to build_string
> often now have two function calls (strlen + make_string),
> not one (just build_string).

On the plus side the argument of build_string is often a constant which
causes the strlen call to be optimized out completely.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



  reply	other threads:[~2012-06-26 15:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-26 14:53 inline build_string performance Paul Eggert
2012-06-26 15:17 ` Andreas Schwab [this message]
2012-06-26 16:29 ` Dmitry Antipov
2012-06-26 16:42   ` Paul Eggert
2012-06-26 17:33     ` Dmitry Antipov
2012-06-26 17:37       ` Paul Eggert
2012-06-26 17:58         ` Dmitry Antipov
2012-06-26 18:46           ` Paul Eggert
2012-06-26 20:41             ` Eli Zaretskii
2012-06-26 18:51           ` Thien-Thi Nguyen
2012-06-27  0:39 ` Stefan Monnier
2012-06-27  3:02   ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=m28vfap0fo.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=Emacs-devel@gnu.org \
    --cc=dmantipov@yandex.ru \
    --cc=eggert@cs.ucla.edu \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).