From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: inline build_string performance Date: Tue, 26 Jun 2012 09:42:57 -0700 Organization: UCLA Computer Science Department Message-ID: <4FE9E691.9090906@cs.ucla.edu> References: <4FE9CCFF.2060309@cs.ucla.edu> <4FE9E374.8010007@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1340729002 6700 80.91.229.3 (26 Jun 2012 16:43:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 26 Jun 2012 16:43:22 +0000 (UTC) Cc: Emacs Development To: Dmitry Antipov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 26 18:43:21 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 1SjYrB-0004tu-Ac for ged-emacs-devel@m.gmane.org; Tue, 26 Jun 2012 18:43:13 +0200 Original-Received: from localhost ([::1]:41450 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SjYrB-0006Ng-CB for ged-emacs-devel@m.gmane.org; Tue, 26 Jun 2012 12:43:13 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56447) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SjYr5-0006NV-Ss for Emacs-devel@gnu.org; Tue, 26 Jun 2012 12:43:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SjYr4-0001Wy-8p for Emacs-devel@gnu.org; Tue, 26 Jun 2012 12:43:07 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:51686) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SjYr4-0001WM-3J for Emacs-devel@gnu.org; Tue, 26 Jun 2012 12:43:06 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 03E69A60005; Tue, 26 Jun 2012 09:43:04 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4PdwKVYVdB06; Tue, 26 Jun 2012 09:43:03 -0700 (PDT) Original-Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id D0F5AA6001A; Tue, 26 Jun 2012 09:43:01 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 In-Reply-To: <4FE9E374.8010007@yandex.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 131.179.128.62 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:151190 Archived-At: On 06/26/2012 09:29 AM, Dmitry Antipov wrote: > > The core idea of this stuff is to eliminate calls to strlen when an > argument of build_string is a compile-time constant That sounds worthwhile for critical paths. How about reverting the build_string change, and defining a new inline function build_literal intended for when the argument is a string literal and for when speed is more important than conserving code space? That would give us speed where speed matters and where we know it'll be faster, while avoiding code bloat otherwise. build_string and build_literal would have identical semantics, but different performance properties.