From b443e9e1a9505944e4878be5da97ba528296ec48 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 26 Oct 2021 10:37:36 +0200 Subject: [PATCH] Kernel: Use a larger kmalloc chunk size on 64-bit platforms This reduces test-js runtime by over 40% on my machine. (And once again we find another way to defer writing a better kernel heap allocator..) --- Kernel/Heap/kmalloc.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Kernel/Heap/kmalloc.cpp b/Kernel/Heap/kmalloc.cpp index 8e3fbbadce..683aa9f158 100644 --- a/Kernel/Heap/kmalloc.cpp +++ b/Kernel/Heap/kmalloc.cpp @@ -23,7 +23,12 @@ #include #include -#define CHUNK_SIZE 32 +#if ARCH(I386) +static constexpr size_t CHUNK_SIZE = 32; +#else +static constexpr size_t CHUNK_SIZE = 64; +#endif + #define POOL_SIZE (2 * MiB) #define ETERNAL_RANGE_SIZE (4 * MiB)