Benchmarks

Real-World Benchmarks — Apple Silicon (ms, lower is better)

Measured on macOS Apple Silicon (ARM64). C, Rust, and Go compile to native ARM64. Jda compiles to x86-64 Mach-O running via Rosetta 2 — a deliberate ISA handicap that makes the wins more striking.

BenchmarkCRustGoJdaRubyPython
Sudoku — 500 puzzles626266413,8541,753
LZ77 — 1 MB compress1,8302,1852,721277222,424
Regex — 8 pats × 100K982218131867,9407,406
B-Tree — 1M ops28229731858611,52910,955
Raytracer — 800×6001921353313,3014,080

Key Results

Full analysis with per-benchmark breakdowns and source code →


Environment

LanguageVersionFlags
CApple clang 21-O2 -lm
Rustrustc 1.94-O
Gogo 1.26default
Jdajda1 v1.1.0build --macos
Ruby4.0.2interpreted
Python3.11interpreted

Jda runs x86-64 via Rosetta 2 — native ARM64 backend is in progress.


Compile Time (ms, lower is better)

gcc -O2rustc -Ogo buildJda
Average4791,49771243
vs Jda11× slower33× slower16× slower

Jda’s single-pass compiler produces native Mach-O binaries directly — no linker step, no intermediate object files. 43ms average compile time.


Reproduce

# Clone the repo
git clone https://github.com/jdalang/jda-lang.git && cd jda-lang

# Build jda1 (needs Docker)
docker run --rm --platform linux/amd64 --ulimit stack=524288000:524288000 \
  -v $(PWD):/jda -w /jda/bootstrap/stage0 jda-build make stage1

# Compile Jda benchmarks for macOS
for b in sudoku lz77 btree regex raytracer; do
  docker run --rm --platform linux/amd64 --ulimit stack=524288000:524288000 \
    -v $(PWD):/jda -w /jda/bootstrap/stage0 jda-build \
    ./jda1 build --macos /jda/benchmarks/complex/$b/$b.jda -o ${b}_mac
  codesign -s - ${b}_mac
done

All source code in benchmarks/complex/ — six implementations of each problem, side by side.

Complex Benchmarks: Jda vs The World

Real-world benchmarks comparing Jda against C, Rust, Go, Python, and Ruby on five non-trivial algorithms: a constraint-propagation sudoku solver, LZ77 compression, Thompson NFA regex, a B-tree, and a ray tracer. Each has full source code in all six languages.

Environment

Measured on macOS Apple Silicon (ARM64). C, Rust, and Go compile to native ARM64. Jda compiles to x86-64 Mach-O running via Rosetta 2 — a deliberate ISA handicap that makes the wins more striking.

ML Benchmark: Jda vs Python

A head-to-head neural network training benchmark comparing Jda and Python. Both implementations use identical algorithms – same loop structure, same SGD optimizer, same MSE loss function. No NumPy on the Python side. The only difference is the runtime: Jda compiles to native x86-64 machine code, Python interprets through CPython.

Performance Results (x86-64 Linux, best of 3)

TaskJdaPython (no NumPy)Speedup
XOR training (5K epochs)21 ms778 ms~37x
Sine training (10K epochs)439 ms15,347 ms~35x
64x64 matmul (per iter)3 ms75 ms~25x

Tasks

Task 1: XOR Classification

  • Architecture: 2->8->1 MLP (multi-layer perceptron)
  • Dataset: 4 XOR samples
  • Training: 5,000 epochs, learning rate 0.1
  • Result: Jda completes in 21 ms vs Python’s 778 ms – a 37x speedup

Task 2: Sine Approximation

  • Architecture: 1->16->1 MLP
  • Dataset: 32 samples of sin(x), x in [0, 2*pi]
  • Training: 10,000 epochs, learning rate 0.01
  • Result: Jda completes in 439 ms vs Python’s 15,347 ms – a 35x speedup

Task 3: Matrix Multiply

  • Size: 64x64 @ 64x64 (524,288 FLOPs per multiply)
  • Iterations: 10
  • Result: Jda averages 3 ms per multiply vs Python’s 75 ms – a 25x speedup

Why the Difference?

Both implementations use identical algorithms. The performance gap comes entirely from the runtime: