mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 13:49:17 +02:00
adding notes about benchmarks for string-ref approaches
This commit is contained in:
parent
c726273c3b
commit
36f188d274
1 changed files with 13 additions and 1 deletions
|
@ -216,7 +216,19 @@
|
||||||
/* You can configure with SEXP_STRING_INDEX_TABLE_CHUNK_SIZE below, */
|
/* You can configure with SEXP_STRING_INDEX_TABLE_CHUNK_SIZE below, */
|
||||||
/* the default is caching every 64th index (<=12.5% string overhead). */
|
/* 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 */
|
/* 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 */
|
/* #define SEXP_USE_STRING_INDEX_TABLE 1 */
|
||||||
|
|
||||||
/* uncomment this to disable automatic closing of ports */
|
/* uncomment this to disable automatic closing of ports */
|
||||||
|
|
Loading…
Add table
Reference in a new issue