Project

Benchmarks

MUL is measured by how many tokens it takes to get a task done correctly. This page tracks the first part of that metric: the size of the same program in MUL and in other languages. Each program prints the same output and exits with the same code in every language (make compare checks it). Shorter bars are fewer tokens.

abundantabundant, MUL: 113 tokens113abundant, Go: 153 tokens (+35.4% vs MUL)153abundant, PHP: 163 tokens (+44.2% vs MUL)163abundant, C: 175 tokens (+54.9% vs MUL)175abundant, Rust: 143 tokens (+26.5% vs MUL)143collatzcollatz, MUL: 91 tokens91collatz, Go: 112 tokens (+23.1% vs MUL)112collatz, PHP: 121 tokens (+33.0% vs MUL)121collatz, C: 130 tokens (+42.9% vs MUL)130collatz, Rust: 116 tokens (+27.5% vs MUL)116digitsdigits, MUL: 95 tokens95digits, Go: 124 tokens (+30.5% vs MUL)124digits, PHP: 131 tokens (+37.9% vs MUL)131digits, C: 144 tokens (+51.6% vs MUL)144digits, Rust: 119 tokens (+25.3% vs MUL)119fibfib, MUL: 49 tokens49fib, Go: 65 tokens (+32.7% vs MUL)65fib, PHP: 58 tokens (+18.4% vs MUL)58fib, C: 71 tokens (+44.9% vs MUL)71fib, Rust: 58 tokens (+18.4% vs MUL)58fizzbuzzfizzbuzz, MUL: 120 tokens120fizzbuzz, Go: 156 tokens (+30.0% vs MUL)156fizzbuzz, PHP: 165 tokens (+37.5% vs MUL)165fizzbuzz, C: 179 tokens (+49.2% vs MUL)179fizzbuzz, Rust: 155 tokens (+29.2% vs MUL)155gcdgcd, MUL: 66 tokens66gcd, Go: 84 tokens (+27.3% vs MUL)84gcd, PHP: 89 tokens (+34.8% vs MUL)89gcd, C: 99 tokens (+50.0% vs MUL)99gcd, Rust: 85 tokens (+28.8% vs MUL)85hellohello, MUL: 22 tokens22hello, Go: 22 tokens (+0.0% vs MUL)22hello, PHP: 15 tokens (-31.8% vs MUL)15hello, C: 25 tokens (+13.6% vs MUL)25hello, Rust: 14 tokens (-36.4% vs MUL)14isqrtisqrt, MUL: 74 tokens74isqrt, Go: 103 tokens (+39.2% vs MUL)103isqrt, PHP: 110 tokens (+48.6% vs MUL)110isqrt, C: 114 tokens (+54.1% vs MUL)114isqrt, Rust: 99 tokens (+33.8% vs MUL)99powerpower, MUL: 108 tokens108power, Go: 133 tokens (+23.1% vs MUL)133power, PHP: 146 tokens (+35.2% vs MUL)146power, C: 148 tokens (+37.0% vs MUL)148power, Rust: 132 tokens (+22.2% vs MUL)132primesprimes, MUL: 106 tokens106primes, Go: 143 tokens (+34.9% vs MUL)143primes, PHP: 153 tokens (+44.3% vs MUL)153primes, C: 164 tokens (+54.7% vs MUL)164primes, Rust: 134 tokens (+26.4% vs MUL)134
MULGoPHPCRust

Numbers

Tokens per file; in brackets, the difference to the MUL version.

Program MUL Go PHP C Rust
abundant 113 153 (+35.4%) 163 (+44.2%) 175 (+54.9%) 143 (+26.5%)
collatz 91 112 (+23.1%) 121 (+33.0%) 130 (+42.9%) 116 (+27.5%)
digits 95 124 (+30.5%) 131 (+37.9%) 144 (+51.6%) 119 (+25.3%)
fib 49 65 (+32.7%) 58 (+18.4%) 71 (+44.9%) 58 (+18.4%)
fizzbuzz 120 156 (+30.0%) 165 (+37.5%) 179 (+49.2%) 155 (+29.2%)
gcd 66 84 (+27.3%) 89 (+34.8%) 99 (+50.0%) 85 (+28.8%)
hello 22 22 (+0.0%) 15 (-31.8%) 25 (+13.6%) 14 (-36.4%)
isqrt 74 103 (+39.2%) 110 (+48.6%) 114 (+54.1%) 99 (+33.8%)
power 108 133 (+23.1%) 146 (+35.2%) 148 (+37.0%) 132 (+22.2%)
primes 106 143 (+34.9%) 153 (+44.3%) 164 (+54.7%) 134 (+26.4%)

How it is measured

The counts come from the offline estimate built into mul tokens: it is deterministic and sends no code anywhere. Its rules are fitted to GPT-style BPE tokenizers, which it matches within about 5% per file on the pilot sample, but it is not the tokenizer of any particular model, so treat the differences as a direction, not an exact figure. mul tokens --tokenizer-cmd counts with a tokenizer of your choice.

Run-time speed is not compared here. The interpreter and the Cranelift backend are checked to give the same results, not tuned for speed, so a timing table against Go or C would say little about the language at this stage.