diff options
author | Ludovic Courtès <ludo@gnu.org> | 2010-09-15 18:38:57 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2010-09-15 18:38:57 +0200 |
commit | fd5eec2b6e113f6d13028215a738417607432a2d (patch) | |
tree | f87058b9bb6f5d2b4b516763e26c663b7e659f9a /benchmark-suite/Makefile.am | |
parent | e9c3018cec8ed236a375c59aed55e66e47671022 (diff) | |
download | guile-fd5eec2b6e113f6d13028215a738417607432a2d.tar.gz |
Optimize `peek-char'.
This makes `peek-char' 40x faster on a port whose encoding is
faster on a UTF-8 port containing multi-byte codepoints.
The `xml->sxml' procedure is 4x faster on a 2.7 MiB XML file.
* libguile/ports.c (get_codepoint): New procedure, moved here from
`scm_getc', with the additional BUF and LEN parameters.
(scm_getc): Use it.
(scm_peek_char): Use it instead of the `scm_getc'/`scm_ungetc'
sequence.
* test-suite/tests/ports.test ("string ports")["peek-char [latin-1]",
"peek-char [utf-8]"]: New tests.
* benchmark-suite/Makefile.am (SCM_BENCHMARKS): Add
`benchmarks/ports.bm'.
* benchmark-suite/benchmarks/ports.bm: New file.
Diffstat (limited to 'benchmark-suite/Makefile.am')
-rw-r--r-- | benchmark-suite/Makefile.am | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/benchmark-suite/Makefile.am b/benchmark-suite/Makefile.am index 9f49f2aad..e2aad9148 100644 --- a/benchmark-suite/Makefile.am +++ b/benchmark-suite/Makefile.am @@ -4,6 +4,7 @@ SCM_BENCHMARKS = benchmarks/0-reference.bm \ benchmarks/continuations.bm \ benchmarks/if.bm \ benchmarks/logand.bm \ + benchmarks/ports.bm \ benchmarks/read.bm \ benchmarks/srfi-1.bm \ benchmarks/srfi-13.bm \ |