unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Nikolaj Schumacher <me@nschum.de>
To: Xah Lee <xahlee@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: efficiency question on text manipulation using string vs buffer
Date: Tue, 24 Mar 2009 21:19:58 +0100	[thread overview]
Message-ID: <m2y6uuptap.fsf@nschum.de> (raw)
In-Reply-To: <01cc8ac5-0b6c-4f7f-8018-73e644b8bf17@p6g2000pre.googlegroups.com> (Xah Lee's message of "Mon, 23 Mar 2009 18:41:08 -0700 (PDT)")

Xah Lee <xahlee@gmail.com> wrote:

> It appears to me, testing these commands on a text selection with
> about 122k chars that needs to be replaced, the second version is only
> 1 second slower? (both finishes within 2 or 3 seconds, on a 2007
> midrange PC)

You should note that the replace-string function is pretty smart.
It only does one big concat, so not that much string manipulation actually
happens in this case.  The majority of time is probably spent on the
regexp search anyway, making direct comparison moot.


regards,
Nikolaj Schumacher




  reply	other threads:[~2009-03-24 20:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-24  1:41 efficiency question on text manipulation using string vs buffer Xah Lee
2009-03-24 20:19 ` Nikolaj Schumacher [this message]
     [not found] ` <mailman.3920.1237926004.31690.help-gnu-emacs@gnu.org>
2009-03-24 22:26   ` Xah Lee
2009-03-25  2:34 ` Kevin Rodgers
     [not found] ` <mailman.3935.1237948501.31690.help-gnu-emacs@gnu.org>
2009-03-25  2:56   ` Xah Lee
2009-03-26  3:07     ` Kevin Rodgers
2009-03-26 16:56     ` Nikolaj Schumacher

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=m2y6uuptap.fsf@nschum.de \
    --to=me@nschum.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=xahlee@gmail.com \
    /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.
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).