chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] string-substitute* slow?


From: felix winkelmann
Subject: Re: [Chicken-users] string-substitute* slow?
Date: Wed, 19 Apr 2006 08:34:13 +0200

On 4/15/06, Daishi Kato <address@hidden> wrote:
> Hi,
>
> I was expecting that string-substitute* is
> faster than calling multiple string-substitute's.
>
> But a simple test showed me the opposite result.
> Any ideas?
>

It turns out that simpler code is often faster code... :-)
I haven't analyzed string-substitute* completely, but it repeatedly
looped over the the smap again and again, which is unneccessary
when string-substitute* is expressed solely with string-substitute.
I have replaced the old version with yours. Moreover it handles
backreferences and an optional mode argument (like
string-substitute).


cheers,
felix




reply via email to

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