From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Colin S. Miller" Newsgroups: gmane.emacs.help Subject: Re: Performance of String Operations Date: Sun, 11 Oct 2009 15:40:07 +0100 Organization: SunSITE.dk - Supporting Open source Message-ID: <4ad1ee45$0$293$14726298@news.sunsite.dk> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1255272304 436 80.91.229.12 (11 Oct 2009 14:45:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 11 Oct 2009 14:45:04 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Oct 11 16:44:54 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MwzfJ-0004Rb-Sm for geh-help-gnu-emacs@m.gmane.org; Sun, 11 Oct 2009 16:44:54 +0200 Original-Received: from localhost ([127.0.0.1]:38877 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MwzfJ-0000xx-83 for geh-help-gnu-emacs@m.gmane.org; Sun, 11 Oct 2009 10:44:53 -0400 Original-Path: news.stanford.edu!usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!feed118.news.tele.dk!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706) Original-Newsgroups: gnu.emacs.help In-Reply-To: Original-Lines: 30 Original-NNTP-Posting-Host: 62.56.61.149 Original-X-Trace: news.sunsite.dk DXC=<\R38HMEIDHnmOLjad>8LM3XVd`MIIdUF Original-X-Complaints-To: staff@sunsite.dk Original-Xref: news.stanford.edu gnu.emacs.help:173750 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:68834 Archived-At: Nordlöw wrote: > Does Emacs contain append/prepend/concat functions for strings that > modify one of its (first) arguments (for side effects only)? > > If so, why not?: Isn't such a function crucial to the performance of a > language, regarding that strings is such a common object type? > > Or does the Emacs compiler optimize such things? Can I somehow > investigate how Emacs has optimized my lisp code? > > /Nordlöw Nordlöw, do you mean instead of (setq a (concat a b c)) you can use (concat-inplace 'a b c) ? I don't think lisp supports the second style. To support it, either all strings have to be over-allocated, or atleast have space after them for growth. HTH, Colin S. Miller -- Replace the obvious in my email address with the first three letters of the hostname to reply.