From 94df8603c640b20e1e2fdc5a69e139dff1ef3101 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Tue, 5 Sep 2017 17:44:25 -0400 Subject: [PATCH] Issue #217 - Use primitives directly if possible --- scheme/cyclone/primitives.sld | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scheme/cyclone/primitives.sld b/scheme/cyclone/primitives.sld index f55f1914..a37e20c1 100644 --- a/scheme/cyclone/primitives.sld +++ b/scheme/cyclone/primitives.sld @@ -939,7 +939,9 @@ ;; ;; Note the only reason to do this is to change from a CPS-style ;; function to one that can be inlined with no CPS, which yields - ;; a significant speed improvement. + ;; a significant speed improvement. Or, alternatively there can + ;; also be a speed improvement if the prim can avoid having to + ;; load C varargs. (define (prim:func->prim func-sym num-args) (define mappings '( @@ -948,6 +950,8 @@ (char=? 2 Cyc-fast-char-gte) (char<=? 2 Cyc-fast-char-lte) + (read-char 1 Cyc-read-char) + (peek-char 1 Cyc-peek-char) )) (let ((m (assoc func-sym mappings)) (udf (assoc func-sym *udf-cps->inline*))