[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: string vs list processing
From: |
Martin Grabmueller |
Subject: |
Re: string vs list processing |
Date: |
Tue, 17 Apr 2001 16:49:30 +0200 |
> From: address@hidden (Bill Gribble)
> Date: Mon, 16 Apr 2001 08:36:04 -0500
>
> On Mon, Apr 16, 2001 at 02:59:15PM +0200, Sascha Ziemann wrote:
> > Any suggestions for a HTTP replay? ;-)
>
> Be smart about when you call string operations. In Gnucash, we use
> guile to assemble multi-megabyte HTML documents. You can't go around
> string-appending every "<" to "p>" to construct this size string; the
> garbage you generate is ridiculous. You will get much better
> performance if you cons up a list of component strings, reverse it at
> the end, and apply string-append to the whole list.
This is what the procedure `reverse-string-concatenate' in SRFI-13 is
for. It takes a list of strings, reverses it and creates a new string
by concatenating the elements of the string list.
<advertise>
If you want that to be fast, check out my SRFI-13 (string library)
implementation, where a call to `reverse-string-concatenate' only
costs you two traversals over the list, one malloc() and one memcpy()
of each element string. I think this is as fast as you can get.
http://www.pintus.de/mgrabmue/guile/guile.html#guile-srfi-13
</advertise>
Regards,
'martin
- Re: SRFI-13 again [was: Re: string vs list processing], (continued)
- Re: SRFI-13 again [was: Re: string vs list processing], Martin Grabmueller, 2001/04/19
- Re: SRFI-13 again [was: Re: string vs list processing], Marius Vollmer, 2001/04/20
- Re: SRFI-13 again [was: Re: string vs list processing], Martin Grabmueller, 2001/04/23
- Re: SRFI-13 again [was: Re: string vs list processing], Marius Vollmer, 2001/04/24
- Re: SRFI-13 again [was: Re: string vs list processing], Martin Grabmueller, 2001/04/25
- Re: SRFI-13 again [was: Re: string vs list processing], Marius Vollmer, 2001/04/30
- Re: SRFI-13 again [was: Re: string vs list processing], Rob Browning, 2001/04/20
- Re: SRFI-13 again [was: Re: string vs list processing], Per Bothner, 2001/04/19
- Re: SRFI-13 again [was: Re: string vs list processing], Martin Grabmueller, 2001/04/19
- Re: SRFI-13 again [was: Re: string vs list processing], Per Bothner, 2001/04/19
- Re: string vs list processing,
Martin Grabmueller <=
- Re: string vs list processing, Jorgen 'forcer' Schaefer, 2001/04/17
- Re: string vs list processing, Martin Grabmueller, 2001/04/18
- Re: string vs list processing, Neil Jerram, 2001/04/17
- Re: string vs list processing, Marius Vollmer, 2001/04/16