help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: efficiency question on text manipulation using string vs buffer


From: Nikolaj Schumacher
Subject: Re: efficiency question on text manipulation using string vs buffer
Date: Tue, 24 Mar 2009 21:19:58 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (darwin)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]