larcenists / larceny

Larceny Scheme implementation
Other
202 stars 32 forks source link

SRFI 135 proposed implementation improvement #824

Open johnwcowan opened 5 years ago

johnwcowan commented 5 years ago

Store an extra flag in the record representing a SRFI 135 text indicating that all its characters are fixed-width. Because texts are immutable, the value of this flag can be determined at construction time. If it is set, a fast dereference operation can be used to find a particular character.

This flag would have no significance when used with kernel0, but would speed up (by a constant factor) access to ASCII-repertoire strings in kernel8 and UCS2-repertoire strings in kernel16, both of which are common cases.