diff --git a/docker-compose.dev-sx-host.yml b/docker-compose.dev-sx-host.yml index 63536980..0e30e483 100644 --- a/docker-compose.dev-sx-host.yml +++ b/docker-compose.dev-sx-host.yml @@ -29,6 +29,10 @@ services: SX_ADMIN_USER: admin SX_ADMIN_PASSWORD: "sx-host-camper-van-2026" SX_SESSION_SECRET: "ra-host-sess-7c1f9b3e2a8d4056" + # Serving-mode JIT: bytecode-compile hot SX (esp. the Datalog/relations path) + # on the epoch serving channel. Validated: host conformance 271/271 under JIT, + # 5.4x faster (1m43s -> 19s). Default-OFF gate, opt in here. + SX_SERVING_JIT: "1" OCAMLRUNPARAM: "b" volumes: # SX source (hot-reload on container restart) diff --git a/lib/host/serve.sh b/lib/host/serve.sh index b2a1090d..3a972938 100755 --- a/lib/host/serve.sh +++ b/lib/host/serve.sh @@ -99,6 +99,17 @@ EPOCH=1 for M in "${MODULES[@]}"; do echo "(epoch $EPOCH)"; echo "(load \"$M\")"; EPOCH=$((EPOCH+1)) done + # Serving-mode JIT: exclude the request-path SX (host app + Dream framework) from + # JIT. Those functions miscompile on first call in the http-listen + cek_run_with_io + # path (a map/rest arg bug → 500, then self-heals via CEK fallback — but the first + # hit fails). They're IO-bound anyway, so CEK is no slower. The JIT win is the + # Datalog/relations saturation (dl-*/relations-*), which JITs cleanly and stays on + # (e.g. /tags 2.5s -> 0.76s). + if [ "${SX_SERVING_JIT:-}" = "1" ]; then + echo "(epoch $EPOCH)" + echo "(eval \"(jit-exclude! \\\"host/*\\\" \\\"dream-*\\\" \\\"dr/*\\\")\")" + EPOCH=$((EPOCH+1)) + fi # Point the blog at the DURABLE file backend (persists under $SX_PERSIST_DIR), # then idempotently seed a welcome post (sx_content = SX element markup, the # editor's content model). Re-seeding is a no-op if the slug already exists.