[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: efficiency question on text manipulation using string vs buffer
From: |
Xah Lee |
Subject: |
Re: efficiency question on text manipulation using string vs buffer |
Date: |
Tue, 24 Mar 2009 15:26:27 -0700 (PDT) |
User-agent: |
G2/1.0 |
On Mar 24, 1:19 pm, Nikolaj Schumacher <m...@nschum.de> wrote:
> XahLee<xah...@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.
Thanks.
Xah
∑ http://xahlee.org/
☄