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.
#1 in Warm-Cache Benchmarks
Section titled “#1 in Warm-Cache Benchmarks”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)”| Benchmark | Chuks VM | Chuks AOT | Java | Node.js | Bun | Python |
|---|---|---|---|---|---|---|
| Fibonacci (fib(38)) | 0.276s | 0.138s | 0.079s | 0.300s | 0.223s | 5.167s |
| Matrix Multiply (200²) | 0.132s | 0.033s | 0.031s | 0.035s | 0.027s | 1.062s |
| Prime Sieve (1M) | 0.138s | 0.035s | 0.030s | 0.029s | 0.014s | 0.134s |
| Quicksort (100K) | 0.222s | 0.044s | 0.034s | 0.041s | 0.044s | 0.144s |
| String Concat (100K) | 0.120s | 0.034s | 0.026s | 0.022s | 0.010s | 0.023s |
| Binary Trees (depth 16) | 0.177s | 0.059s | 0.037s | 0.038s | 0.028s | 0.597s |
| N-Body (500K steps) | 0.147s | 0.046s | 0.054s | 0.048s | 0.037s | 4.519s |
| OOP (100K objects) | 0.140s | 0.035s | 0.027s | 0.021s | 0.011s | 0.058s |
| Map Operations (100K) | 0.163s | 0.046s | 0.056s | 0.040s | 0.028s | 0.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)”| Benchmark | Chuks AOT | Go | Ratio |
|---|---|---|---|
| Fibonacci (fib(38)) | 0.088s | 0.084s | 1.05x |
| Matrix Multiply (200²) | 0.006s | 0.005s | 1.2x |
| Quicksort (100K) | 0.007s | 0.007s | 1.0x |
| Binary Trees (depth 16) | 0.028s | 0.028s | 1.0x |
| N-Body (500K steps) | 0.018s | 0.018s | 1.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)”| Runtime | Single | Parallel | Speedup |
|---|---|---|---|
| Chuks AOT | 111ms | 40ms | 2.8x |
| Go | 117ms | 39ms | 3.0x |
| Java | 129ms | 49ms | 2.6x |
| Node.js | 182ms | 71ms | 2.6x |
| Bun.js | 127ms | 51ms | 2.5x |
| Python | 7933ms | 2661ms | 3.0x |
Why Typed Code Matters
Section titled “Why Typed Code Matters”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 dispatchvar node: any = createNode(depth)
// After (v0.0.6) — direct struct access, zero overheadvar 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.
AOT Compiler Fixes
Section titled “AOT Compiler Fixes”Nil Comparison for Typed Pointer Fields
Section titled “Nil Comparison for Typed Pointer Fields”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 AOTif (node.left != null) { // ...}Windows Upgrade Fix
Section titled “Windows Upgrade Fix”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.
22 New Tests
Section titled “22 New Tests”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.
Numbers
Section titled “Numbers”| Metric | Count |
|---|---|
| Golden tests (VM + AOT) | 157 |
| New tests added | 22 |
| Benchmark categories | 9 |
| Benchmark ranking | #1 overall (warm-cache) |
| Platforms supported | 5 (macOS arm64/amd64, Linux arm64/amd64, Windows amd64) |