[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: string vs list processing
From: |
Michael Livshin |
Subject: |
Re: string vs list processing |
Date: |
16 Apr 2001 17:59:15 +0300 |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Crater Lake) |
address@hidden (Harvey J. Stein) writes:
> That (string-ref str 0) takes about the same time as (list-ref lst 0)
> is good. The string ref is checking arguments, indexing into the
> array & returning a char. The list-ref is checking arguments &
> dereferencing car of lst. Actually, I'm a little surprised that
> (string-ref ...) isn't slower.
??? string-ref is of constant complexity, whereas list-ref is of
linear complexity.
shouldn't matter with sizes <100, but certainly should matter in
general.
> Doesn't the string-ref have to malloc
> to create the character that it's returning, whereas the list-ref
> doesn't?
no, Guile chars are immediate.
--
The only thing better than TV with the sound off is Radio with the sound
off.
-- Dave Moon
Re: string vs list processing, Masao Uebayashi, 2001/04/16
- Re: string vs list processing, Sascha Ziemann, 2001/04/16
- Re: string vs list processing, Masao Uebayashi, 2001/04/16
- Re: string vs list processing, Michael Livshin, 2001/04/16
- Re: string vs list processing, Bill Gribble, 2001/04/16
- Re: string vs list processing, Michael Livshin, 2001/04/16
- SRFI-13 again [was: Re: string vs list processing], Martin Grabmueller, 2001/04/17
- Re: SRFI-13 again [was: Re: string vs list processing], Dirk Herrmann, 2001/04/19