Skip to content

Performance Guide

This content is for v1.0. Switch to the latest version for up-to-date documentation.

RayQuiro provides three distinct execution tiers to give you the ideal balance between instant development turnaround and production-grade execution speed.


Execution ModeCommandStartup LatencyExecution SpeedUse Case
Native Binary (LLVM)rqio build --releaseZero (direct native binary)Maximum (C/Rust speed)Production releases, games, desktop apps, servers
Bytecode VMrqio run script.rqInstant (~5ms)Fast (JIT-like speed)Daily development, rapid testing, scripts
Tree-Walk Interpreterrqio run --legacyInstant (~2ms)BaselineDebugging, embedded systems, microcontrollers

When you run:

Terminal window
rqio build main.rq --release -o app.exe

RayQuiro runs full LLVM compilation with -O3:

  • Constant folding & propagation
  • Inlining of small functions
  • Dead code elimination (DCE)
  • Loop unrolling and auto-vectorization
  • Memory-to-register promotion (mem2reg)

The resulting binary executes directly on CPU registers with no virtual machine dispatch loop.


In tight loops, cache len(arr) in a local variable:

var n = len(items);
var i = 0;
while (i < n) {
process(items[i]);
i = i + 1;
}

Avoid repeatedly creating temporary arrays inside hot inner loops.

3. Use Native Built-ins for Bulk Operations

Section titled “3. Use Native Built-ins for Bulk Operations”

Built-ins like crypto.*, hash.*, regex.*, and math.* execute in compiled C/C++ without VM overhead.

Always measure using monotonic timers:

var t0 = time.now_ms();
compute_heavy_algorithm();
var delta = time.now_ms() - t0;
print("Computation time: " + str(delta) + " ms");