diff --git a/include/chibi/features.h b/include/chibi/features.h index 257dd2f6..ccd3319a 100644 --- a/include/chibi/features.h +++ b/include/chibi/features.h @@ -216,7 +216,19 @@ /* You can configure with SEXP_STRING_INDEX_TABLE_CHUNK_SIZE below, */ /* the default is caching every 64th index (<=12.5% string overhead). */ /* With a minimum of 1 you'd have up to 8x string overhead, and */ -/* string-ref would still be slightly slower than string-cursors. */ +/* string-ref would still be slightly slower than string-cursors, */ +/* and string-append would be marginally slower as well. */ +/* */ +/* In practice, the overhead of iterating over a string with */ +/* string-ref isn't noticeable until about 10k chars. Times */ +/* for iteration using the different approaches: */ +/* */ +/* impl\len 1000 10000 100000 1000000 */ +/* string-ref (utf8) 1 97 9622 x */ +/* string-ref (fast) 0 2 19 216 */ +/* cursor-ref (srfi 130) 0 4 18 150 */ +/* text-ref (srfi 135) 2 27 211 2006 */ +/* */ /* #define SEXP_USE_STRING_INDEX_TABLE 1 */ /* uncomment this to disable automatic closing of ports */