aboutsummaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2025-01-11 20:35:40 +0100
committerbptato <nincsnevem662@gmail.com>2025-01-11 20:35:40 +0100
commit51d4356e5466aa4295360d107d6af2ac0ff65aa7 (patch)
tree50e7a759b6121488093a01ed1e2a975521847fc2 /src/server
parentfcd0bd7e8924273ded0b5bb0f85e38735437786f (diff)
downloadchawan-51d4356e5466aa4295360d107d6af2ac0ff65aa7.tar.gz
loader: fix loader buffer page size optimization
The goal is to get "SmallChunk" pages from the allocator. I think I stole the idea from faststreams, but the overhead might be different with raw pointers...
Diffstat (limited to 'src/server')
-rw-r--r--src/server/loader.nim6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/server/loader.nim b/src/server/loader.nim
index 76952eab..474700df 100644
--- a/src/server/loader.nim
+++ b/src/server/loader.nim
@@ -49,7 +49,11 @@ import types/referrer
import types/url
import utils/twtstr
-const LoaderBufferPageSize = 4064 # 4096 - 32
+# Try to make it a SmallChunk.
+# We must subtract SmallChunk size, and then FreeCell size.
+# (See system/alloc.nim for details.)
+#TODO measure this on 32-bit too, we get a few more bytes there
+const LoaderBufferPageSize = 4016 # 4096 - 64 - 16
type
LoaderBufferObj = object