Subject: Re: HOWTO resize an existing string with MzScheme??
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 2000/01/28
Newsgroups: comp.lang.scheme
Message-ID: <86r1rj$vc63a@fido.engr.sgi.com>
Leo Razoumov  <see_signature@127.0.0.1> wrote:
+---------------
| SCM primitive (vector-set-length! ...) proved itself to be very useful. 
| This is precisely why I am missing it so much in MzScheme.
| Concering the cost of an additional pointer redirection it is certainly less
| than the cost of copying the contents of an old string into the newly
| allocated one. Savings due to realloc(...) compared to malloc(...) can
| be significant if you have enough non-fragmented free memory.
+---------------

But this can also work *against* you if you have a really high-performance
copying collector, where copying small-to-medium-sized in-line strings is
*cheaper*, because it trivially allows you to compact memory.

+---------------
| I think that SCM uniform vectors is a *great* optimization idea worth
| while to become a SFRI and being included in other implementations. 
+---------------

But as I said, they can be quite *non*-optimal with some garbage collector
styles. Adjustable vectors & strings, if you have them at all, should be
optional (and *NOT* mandated by any SRFI as the default).


-Rob

-----
Rob Warnock, 8L-846		rpw3@sgi.com
Applied Networking		http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.		Phone: 650-933-1673
1600 Amphitheatre Pkwy.		FAX: 650-933-0511
Mountain View, CA  94043	PP-ASEL-IA