Skip to content

Chuks v0.0.6 — Benchmark Champion

Chuks v0.0.6 polishes the AOT compiler and proves its performance story with comprehensive benchmarks. This release fixes edge cases, adds 22 new tests, and puts Chuks at the top of the leaderboard.

After converting the remaining benchmarks from any-typed to fully typed code, Chuks AOT now ranks #1 overall in warm-cache benchmarks across 9 test categories — ahead of Go, Node.js, Python, Java, and C#.

The warm-cache metric matters because it measures steady-state performance — how fast your code runs after JIT compilation, OS caches, and memory allocation have stabilized. This is what production servers experience.

Compute Benchmarks (cold-start, wall-clock time)

Section titled “Compute Benchmarks (cold-start, wall-clock time)”
BenchmarkChuks VMChuks AOTJavaNode.jsBunPython
Fibonacci (fib(38))0.276s0.138s0.079s0.300s0.223s5.167s
Matrix Multiply (200²)0.132s0.033s0.031s0.035s0.027s1.062s
Prime Sieve (1M)0.138s0.035s0.030s0.029s0.014s0.134s
Quicksort (100K)0.222s0.044s0.034s0.041s0.044s0.144s
String Concat (100K)0.120s0.034s0.026s0.022s0.010s0.023s
Binary Trees (depth 16)0.177s0.059s0.037s0.038s0.028s0.597s
N-Body (500K steps)0.147s0.046s0.054s0.048s0.037s4.519s
OOP (100K objects)0.140s0.035s0.027s0.021s0.011s0.058s
Map Operations (100K)0.163s0.046s0.056s0.040s0.028s0.057s

Cold-start times include ~130ms macOS page-cache overhead for compiled binaries. Warm-cache results below show the true computation cost.

Warm-Cache Results — Chuks AOT vs Go (median of 3, user time)

Section titled “Warm-Cache Results — Chuks AOT vs Go (median of 3, user time)”
BenchmarkChuks AOTGoRatio
Fibonacci (fib(38))0.088s0.084s1.05x
Matrix Multiply (200²)0.006s0.005s1.2x
Quicksort (100K)0.007s0.007s1.0x
Binary Trees (depth 16)0.028s0.028s1.0x
N-Body (500K steps)0.018s0.018s1.0x

5 of 9 benchmarks within 1.0–1.2x of Go. Chuks AOT ranked #1 overall by average position across all 9 benchmarks.

Parallel Compute — Prime Count to 5M (4 workers)

Section titled “Parallel Compute — Prime Count to 5M (4 workers)”
RuntimeSingleParallelSpeedup
Chuks AOT111ms40ms2.8x
Go117ms39ms3.0x
Java129ms49ms2.6x
Node.js182ms71ms2.6x
Bun.js127ms51ms2.5x
Python7933ms2661ms3.0x

Two benchmarks (binary_trees and map_operations) were previously written with any types, which forced the AOT compiler to use dynamic dispatch. Converting them to explicit types unlocked the full optimization pipeline:

// Before (v0.0.5) — forces dynamic dispatch
var node: any = createNode(depth)
// After (v0.0.6) — direct struct access, zero overhead
var node: TreeNode = createNode(depth)

This isn’t just a benchmark trick — it’s the same performance difference your production code gets when you use typed variables instead of any.

When a class had a property typed as another class (a pointer field), comparing it to null in AOT mode generated incorrect native code. The compiler was emitting the wrong comparison for reference types vs value types.

class Node {
var left: Node? = null
}
// This comparison now works correctly in AOT
if (node.left != null) {
// ...
}

The chuks upgrade command on Windows was failing with a gzip error because Windows releases are distributed as .zip files, not .tar.gz. The upgrade logic now detects the platform and uses the correct extraction method.

Additionally, the Windows binary replacement strategy now uses a rename-to-.old approach to handle locked executables — a common issue when the running binary is the one being replaced.

New stability and edge-case tests covering:

  • Async pipelines and try/closure patterns
  • Boundary conditions and deeply nested structures
  • Class hierarchy and complex inheritance
  • Closure stress testing
  • Concurrency patterns
  • Data processing pipelines
  • Error propagation
  • Functional patterns
  • Generic advanced patterns
  • Interface comprehensive tests
  • Real-world patterns and recursion algorithms
  • Scope isolation and state management
  • String edge cases
  • Type coercion and type system stress

All 157 tests pass in both VM and AOT modes.

MetricCount
Golden tests (VM + AOT)157
New tests added22
Benchmark categories9
Benchmark ranking#1 overall (warm-cache)
Platforms supported5 (macOS arm64/amd64, Linux arm64/amd64, Windows amd64)