From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.devel Subject: Re: inline build_string performance Date: Tue, 26 Jun 2012 17:17:31 +0200 Message-ID: References: <4FE9CCFF.2060309@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1340723869 26268 80.91.229.3 (26 Jun 2012 15:17:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 26 Jun 2012 15:17:49 +0000 (UTC) Cc: Dmitry Antipov , Emacs Development To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 26 17:17:48 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SjXWV-00043g-QT for ged-emacs-devel@m.gmane.org; Tue, 26 Jun 2012 17:17:47 +0200 Original-Received: from localhost ([::1]:59310 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SjXWV-0007Kx-Mc for ged-emacs-devel@m.gmane.org; Tue, 26 Jun 2012 11:17:47 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SjXWO-0007Jm-8E for Emacs-devel@gnu.org; Tue, 26 Jun 2012 11:17:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SjXWH-0004x1-Uk for Emacs-devel@gnu.org; Tue, 26 Jun 2012 11:17:39 -0400 Original-Received: from mail-out.m-online.net ([212.18.0.9]:34818) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SjXWH-0004wf-P6 for Emacs-devel@gnu.org; Tue, 26 Jun 2012 11:17:33 -0400 Original-Received: from frontend4.mail.m-online.net (unknown [192.168.8.183]) by mail-out.m-online.net (Postfix) with ESMTP id 3WM9qC3mtjz4KKQZ; Tue, 26 Jun 2012 17:17:43 +0200 (CEST) X-Auth-Info: 0Ml053KTnmjniehJXiX4JkmgVY3Eyx7HtkEVIIunu0k= Original-Received: from igel.home (ppp-88-217-113-177.dynamic.mnet-online.de [88.217.113.177]) by mail.mnet-online.de (Postfix) with ESMTPA id 3WM9pz4j36zbbtg; Tue, 26 Jun 2012 17:17:31 +0200 (CEST) Original-Received: by igel.home (Postfix, from userid 501) id 463E5CA2A6; Tue, 26 Jun 2012 17:17:31 +0200 (CEST) X-Yow: Now I'm telling MISS PIGGY about MONEY MARKET FUNDS! In-Reply-To: <4FE9CCFF.2060309@cs.ucla.edu> (Paul Eggert's message of "Tue, 26 Jun 2012 07:53:51 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 212.18.0.9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:151186 Archived-At: Paul Eggert 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."