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: Daishi Kato
Subject: Re: [Chicken-users] string-substitute* slow?
Date: Wed, 19 Apr 2006 17:26:35 +0900
User-agent: Wanderlust/2.15.2 (Almost Unreal) Emacs/21.4 Mule/5.0 (SAKAKI)

At Wed, 19 Apr 2006 08:34:13 +0200,
felix winkelmann wrote:
> 
> 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).

Oh, no. Could there be a better way with string-substitute*?
I don't believe that my workaround is the fastest.
I'll look into the code of string-substitute* later.

Another note is that if the input/output can be ports instead of strings.
An instant look of the code tells me internal procedures except string,
so there would require much work to change that.

Daishi




reply via email to

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