From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: Returning argument string (regexp-quote) Date: Tue, 24 Sep 2019 11:24:12 -0700 Organization: UCLA Computer Science Department Message-ID: <0c4254dd-42ea-5e47-f1b5-c00a326753e2@cs.ucla.edu> References: <83sgoloedi.fsf@gnu.org> <658AF539-1AE7-459D-94C7-44970AA94EEF@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="32793"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 Cc: Eli Zaretskii , emacs-devel@gnu.org To: =?UTF-8?Q?Mattias_Engdeg=c3=a5rd?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 24 20:24:40 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iCpUK-0008N6-R5 for ged-emacs-devel@m.gmane.org; Tue, 24 Sep 2019 20:24:36 +0200 Original-Received: from localhost ([::1]:49810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCpUI-0007fw-DV for ged-emacs-devel@m.gmane.org; Tue, 24 Sep 2019 14:24:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49228) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCpU5-0007d8-Sy for emacs-devel@gnu.org; Tue, 24 Sep 2019 14:24:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCpU4-0005eY-9r for emacs-devel@gnu.org; Tue, 24 Sep 2019 14:24:21 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:39120) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCpU2-0005S9-FE; Tue, 24 Sep 2019 14:24:18 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id B6A571601BF; Tue, 24 Sep 2019 11:24:13 -0700 (PDT) Original-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 qPl-o19xSCnm; Tue, 24 Sep 2019 11:24:13 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 06CCD16022F; Tue, 24 Sep 2019 11:24:13 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-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 5fL7t1v3H04P; Tue, 24 Sep 2019 11:24:12 -0700 (PDT) Original-Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id E11C81601BF; Tue, 24 Sep 2019 11:24:12 -0700 (PDT) In-Reply-To: <658AF539-1AE7-459D-94C7-44970AA94EEF@acm.org> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.org gmane.emacs.devel:240281 Archived-At: On 9/24/19 10:44 AM, Mattias Engdeg=C3=A5rd wrote: > What about the specific case of regexp-quote then? > It was responsible for a sizeable portion of local consing in some (non= -public) code I was profiling. > Would the change need a mention in NEWS, and/or its doc string? The performance case for regexp-quote is reasonably strong. This is=20 similar to the 'format' function, which is called a lot, which does not=20 allocate a string if its argument is simple, and where its callers are=20 extremely unlikely to rely on its allocating a string in that case. Changes should be mentioned in NEWS and the adjusted behavior should be=20 mentioned in the manual; I don't think it needs to be in the doc string.=20 Please see commit 2017-10-04T21:29:58Z!eggert@cs.ucla.edu for how the=20 doc was done in the 'format' case.