1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00
guile/benchmark-suite
Ludovic Courtès fd5eec2b6e 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.
2010-09-15 18:38:57 +02:00
..
benchmarks Optimize `peek-char'. 2010-09-15 18:38:57 +02:00
results Changes so that benchmark-guile runs successfully 2009-09-22 00:39:57 +01:00
ChangeLog-2008 Rename ChangeLog' files to ChangeLog-2008'. 2008-09-12 21:49:58 +02:00
guile-benchmark deprecate has-suffix? 2010-06-11 16:58:24 +02:00
lib.scm Changes so that benchmark-guile runs successfully 2009-09-22 00:39:57 +01:00
Makefile.am Optimize `peek-char'. 2010-09-15 18:38:57 +02:00
README Revert "Note need for subscription to bug-guile@gnu.org." 2008-12-10 19:07:14 +00:00

This directory contains some benchmarks for Guile, and some generic
benchmarking support code.

To run these benchmarks, you will need a version of Guile more recent
than 15 Feb 1999 --- the benchmarks use the (ice-9 and-let*) and
(ice-9 getopt-long) modules, which were added to Guile around then.

For information about how to run the benchmark suite, read the usage
instructions in the comments at the top of the guile-benchmark script.

You can reference the file `lib.scm' from your own code as the module
(benchmark-suite lib); it also has comments at the top and before each
function explaining what's going on.

Please write more Guile benchmarks, and send them to bug-guile@gnu.org.
We'll merge them into the distribution.  All benchmark suites must be
licensed for our use under the GPL, but I don't think we're going to
collect assignment papers for them.