From 7786181722011a21dd29c6dc351fe12e6b31b0b6 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Thu, 3 Oct 2019 16:22:01 -0400 Subject: [PATCH] Micro-optimization: speed up equal() a bit Just see if x and y are the same before type checking; this shaves off a bit of time in the benchmark (IE, under heavy loads). --- runtime.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/runtime.c b/runtime.c index d4a0f541..c8e12b8c 100644 --- a/runtime.c +++ b/runtime.c @@ -632,6 +632,8 @@ void Cyc_rt_raise_msg(void *data, const char *err) int equal(object x, object y) { + if (x == y) + return 1; if (x == NULL) return (y == NULL); if (y == NULL)