guile-user
[Top][All Lists]
Advanced

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

Re: string vs list processing


From: Neil Jerram
Subject: Re: string vs list processing
Date: 17 Apr 2001 22:56:16 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

>>>>> "Bill" == Bill Gribble <address@hidden> writes:

    Bill> Be smart about when you call string operations.  In Gnucash,
    Bill> we use guile to assemble multi-megabyte HTML documents.  You
    Bill> can't go around string-appending every "<" to "p>" to
    Bill> construct this size string; the garbage you generate is
    Bill> ridiculous.  You will get much better performance if you
    Bill> cons up a list of component strings, reverse it at the end,
    Bill> and apply string-append to the whole list.

So one could imagine a `lazy' implementation of string-append that did
this automatically.  With almost no thought, I guess that the issues
involved would be very similar to those for copy-on-write.

On the other hand, perhaps doing this would be to encourage bad
programming habits?

Regards,
        Neil



reply via email to

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