summaryrefslogtreecommitdiffstats
path: root/stream.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-04-22 06:42:32 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-04-22 06:42:32 -0700
commit7fef3c0d7cdad433fbf614ad4b5c30b7f99814c8 (patch)
tree89b3d4c9b2a2349df5ff833a467f97ea994c2bb5 /stream.h
parented0bfb4b8eb40d8a4efc65e528e477a2314b34aa (diff)
downloadtxr-7fef3c0d7cdad433fbf614ad4b5c30b7f99814c8.tar.gz
txr-7fef3c0d7cdad433fbf614ad4b5c30b7f99814c8.tar.bz2
txr-7fef3c0d7cdad433fbf614ad4b5c30b7f99814c8.zip
parser: batched read operation for speed.
As a result of this change, the startup time is reduced. The command txr -e '(compile-toplevel nil)' shows a 54% speedup: around 110 milliseconds down from around 170. Programs that read large amounts of TXR Lisp data will benefit. * parser.l (YY_INPUT): Use new get_bytes function instead of get_byte to read a buffer at a time. * stream.c (get_bytes): New function. * stream.h (get_bytes): Declared.
Diffstat (limited to 'stream.h')
-rw-r--r--stream.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/stream.h b/stream.h
index ba905871..197be303 100644
--- a/stream.h
+++ b/stream.h
@@ -194,6 +194,7 @@ val clear_error(val stream);
val get_line(val);
val get_char(val);
val get_byte(val);
+val get_bytes(val self, val, mem_t *ptr, ucnum len);
val unget_char(val ch, val stream);
val unget_byte(val byte, val stream);
val put_buf(val buf, val pos, val stream);