From 8f7b4d8c4f64bc648c1793c5fd957af43631a994 Mon Sep 17 00:00:00 2001
From: Kimplul <kimi.h.kuparinen@gmail.com>
Date: Thu, 12 Dec 2024 19:19:55 +0200
Subject: add todo about minimizing mmap syscalls

---
 src/compile/compile.c | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'src/compile')

diff --git a/src/compile/compile.c b/src/compile/compile.c
index 804a29f..2d1ec5f 100644
--- a/src/compile/compile.c
+++ b/src/compile/compile.c
@@ -2064,6 +2064,10 @@ bool ejit_compile(struct ejit_func *f, bool use_64)
 	if (!init_jit())
 		return false;
 
+	/* the main overhead of compilation seems to be the syscall to mmap a
+	 * new arena, I might look into allocating a big buffer at once and
+	 * caching it to be reused later, might allow us to compile many small
+	 * functions faster */
 	jit_state_t *j = jit_new_state(NULL, NULL);
 	assert(j);
 
-- 
cgit v1.2.3