From 36acb56a3a3bf4c48d69ad789745e261d0236886 Mon Sep 17 00:00:00 2001 From: giles Date: Fri, 3 Apr 2026 17:08:24 +0000 Subject: [PATCH] Quiet noisy JIT compilation logs: only log slow (>500ms) or failed compiles Co-Authored-By: Claude Opus 4.6 (1M context) --- hosts/ocaml/bin/sx_server.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hosts/ocaml/bin/sx_server.ml b/hosts/ocaml/bin/sx_server.ml index 258dedde..55b3db91 100644 --- a/hosts/ocaml/bin/sx_server.ml +++ b/hosts/ocaml/bin/sx_server.ml @@ -825,8 +825,9 @@ let register_jit_hook env = let compiled = Sx_vm.jit_compile_lambda l (env_to_vm_globals env) in let dt = Unix.gettimeofday () -. t0 in _jit_compiling := false; - Printf.eprintf "[jit] %s compile %s in %.3fs\n%!" - fn_name (match compiled with Some _ -> "OK" | None -> "FAIL") dt; + if dt > 0.5 || (match compiled with None -> true | _ -> false) then + Printf.eprintf "[jit] %s compile %s in %.3fs\n%!" + fn_name (match compiled with Some _ -> "OK" | None -> "FAIL") dt; match compiled with | Some cl -> l.l_compiled <- Some cl;