JIT Compilation
JIT Compilation
The JIT Compilation module requests and inspects native compilation of supported Scheme procedures. JIT availability depends on the build and architecture; the current native emitter targets x86-64.
Compilation is an optimization, not a semantic mode. Unsupported procedures remain interpreted, and diagnostic helpers can report unexpected fallback without changing the procedure's result.
MemCP's performance roadmap extends native compilation from individual supported procedures toward complete shard-local scan loops: storage decoders provide known value types, filter/map/reduce expressions become one tight loop, and vectorized batches amortize callback overhead. Additional architecture backends remain planned rather than current support.
JIT coverage is an active performance boundary. Real application workloads can currently lose to MySQL when important operators remain interpreted or compilation cost dominates a short query. The goal is broader native coverage without weakening garbage-collector safety, cancellation, pointer lifetime or interpreter-equivalent results.
jit
compiles a lambda to optimized native code when this build enables JIT
Allowed number of parameters: 1–1
Parameters
- fn (
any): the function to compile
Returns
- value (
any)
jit?
tells whether a value is a JIT-compiled function descriptor
Allowed number of parameters: 1–1
Parameters
- value (
any): value to inspect
Returns
- value (
bool)
jit-warn-if-fallback
prints a diagnostic warning when an enabled JIT build kept a procedure interpreted and returns the procedure unchanged
Allowed number of parameters: 1–2
Parameters
- procedure (
any): procedure expected to be a native compilation candidate - label (
string): optional diagnostic label (optional)
Returns
- value (
any)
jit-enabled?
tells whether this binary was built with the patched Go JIT runtime
Allowed number of parameters: 0–0
Parameters
This function has no parameters.
Returns
- value (
bool)