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

efficiency suggestions/quibbles

This page is part of the web mail archives of SRFI 40 from before July 7th, 2015. The new archives for SRFI 40 contain all messages, not just those from before July 7th, 2015.



Although I recognize that the reference implementation
needn't be optimized, I couldn't help but make a few
suggestions:

As stream->list is used in many places, it could be
imperative, or at least use built-in R5RS reverse.

Functions that expand their entire argument (e.g.
stream-reverse, stream-scan-right) could probably save
space by using real lists as intermediate data
structures, rather than building nested stream-conses.
 They would return their results via list->stream.

The functions vector->stream, stream->vector,
string->stream, and stream->string should not use
lists as intermediate values, because a list may take
up much more memory than its corresponding vector or
string.  Converting vectors and strings directly to
streams is trivial, while stream->string and
stream->vector could use a simple buffer/concatenate
strategy with just R5RS primitives.



__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com