mit-scheme-devel
[Top][All Lists]
Advanced

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

Re: [MIT-Scheme-devel] string-head!


From: Joe Marshall
Subject: Re: [MIT-Scheme-devel] string-head!
Date: Thu, 24 Sep 2009 16:10:12 -0700

On Thu, Sep 24, 2009 at 3:40 PM, Taylor R Campbell <address@hidden> wrote:
>   Date: Thu, 24 Sep 2009 13:48:34 -0700
>   From: Joe Marshall <address@hidden>
>
>   Has anyone measured the performance difference between smashing
>   the string head and just taking a substring?  I'd bet it's a pretty minimal
>   improvement against the background of the other things that happen during 
> I/O.
>
> I conducted a thoroughly unscientific comparison whose source code is
> attached: making a string of length 2^(i + 1), taking a prefix of
> length 2^i, and then discarding it, repeating the process ten thousand
> times.

I haven't seen much production code that uses it in this way.

I don't doubt that it is quicker to truncate the string than to copy it.  I was
wondering if it took up a significant amount of time when calling
WITH-OUTPUT-TO-STRING or INPUT-PORT/READ-STRING



-- 
~jrm




reply via email to

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