Navigation
Syntax Guide
Learn Logic
StudioCratesRoadmapContactNewsBenchmarks
ProfileGitHub

Benchmarks

LOGOS compiles to Rust. Rust-level performance, English-level readability.

v0.10.08421ae9Intel(R) Core(TM) i9-14900KUbuntu 24.04.2 LTS x86_642026-07-09Raw JSON
LOGOS compiled vs C
2.62x*
the speed of C (geomean)
Same algorithm as C
1.27x
the speed of C (geomean)
Interpreted LOGOS vs V8
1.04x
the speed of V8 (geomean)
The headline covers all 32 benchmarks. On 5 of them the LOGOS compiler reduces the work itself, for example by folding a recursive function into a closed form, so it runs a faster algorithm than the C version rather than just faster machine code. Those wins are real, and the generated Rust for each is shown in the Source Code section below. The second number is the geometric mean over the remaining 27 benchmarks, where LOGOS and C compile the same algorithm. Both numbers are “x the speed of C”, so higher is faster.
Recursive Fibonacci
Naive recursive Fibonacci. (n = 40)
This one collapsed. The LOGOS optimizer folds the naive recursion to a closed form, so it does far less work than the runtime recursion the other languages execute — a compiler transform, not like-for-like codegen. See the generated Rust below.
Wall-clock time at n = 40 — shorter bar is faster.
Systems
LOGOS
442µs
C
93.4ms
C++
94.0ms
Rust
163.3ms
Zig
168.7ms
Managed
Java
268.3ms
Go
282.5ms
Transpiled
Nim
232.1ms
Scaling — time vs problem size (log–log)
517.5ms442µsn=30n=35n=40
C
C++
Rust
Zig
LOGOS
Go
Java
JavaScript
Nim
Complexity
time O(2^n)space O(n)
Measured time growth
Ct ≈ n^13.20
C++t ≈ n^13.21
Rustt ≈ n^14.53
Zigt ≈ n^14.65
LOGOSt ≈ n^-0.11
Got ≈ n^14.59
Javat ≈ n^8.79
JavaScriptt ≈ n^11.26
Nimt ≈ n^15.15
Measured space growth
Crss ≈ n^-0.65
C++rss ≈ n^-0.65
Rustrss ≈ n^0.00
Zigrss ≈ n^0.00
LOGOSrss ≈ n^0.00
Gorss ≈ n^-0.03
Javarss ≈ n^0.04
JavaScriptrss ≈ n^0.02
Nimrss ≈ n^0.00
Memory — peak resident set size
Peak resident memory at n = 40 — shorter bar uses less.
Zig
256 KB
C
1.2 MB
C++
1.2 MB
Nim
1.2 MB
Rust
1.5 MB
LOGOS
1.8 MB
Go
1.8 MB
Java
44.0 MB
JavaScript
47.8 MB
Binary size — compiled-artifact footprint
Shipped size of the compiled program — the stripped, code-only binary you actually deploy, so every language is compared on the same basis. Shorter bar ships less; the as-built size (with symbols) is in parentheses.
Java
1 KB (1 KB as-built)
C
14 KB (16 KB as-built)
C++
14 KB (16 KB as-built)
Zig
20 KB (878 KB as-built)
Nim
62 KB (73 KB as-built)
Rust
300 KB (1.9 MB as-built)
LOGOS
327 KB (2.1 MB as-built)
Go
1.2 MB (1.8 MB as-built)
The size of the program you actually ship. C and C++ stay tiny because the runtime lives in the system libc; Rust and Go statically link their runtimes; LOGOS compiles to a compact self-contained binary in between. Java’s figure is its bytecode alone — it still needs the JVM to run — and JavaScript has no compiled artifact at all (its footprint is the V8 engine, in the Interpreter section). As-built is the real shipped file; stripped removes debug symbols for a code-only comparison.
LanguageMeanMedianStdDevMinMaxUserSystemCVRuns
LOGOS448µs442µs±34µs414µs539µs307µs190µs0.07610
C94.8ms93.4ms±6.0ms90.5ms109.4ms94.0ms600µs0.06310
C++94.2ms94.0ms±2.5ms91.7ms100.3ms93.1ms857µs0.02610
Rust163.1ms163.3ms±7.1ms152.9ms175.9ms162.6ms368µs0.04310
Zig165.5ms168.7ms±6.5ms155.0ms172.6ms164.9ms370µs0.03910
Nim231.8ms232.1ms±4.1ms226.9ms238.6ms231.0ms578µs0.01810
Java268.4ms268.3ms±3.9ms262.5ms272.8ms260.3ms12.3ms0.01410
Go281.1ms282.5ms±4.0ms272.5ms285.7ms280.9ms1.6ms0.01410
LOGOS vs JavaScript / V8
The LOGOS engine ladder — bytecode VM, copy-and-patch JIT, and the warm AOT-native tier — against Node v22.22.3 / V8.
6.0x
faster cold start than V8
2.3ms
LOGOS interpreter cold start
1.04x
the speed of V8 on compute (geomean)
Cold start — launch the engine and run a trivial program (50 runs, shorter is faster)
LOGOS interp
2.3ms
Node / V8
13.8ms
A native binary has no VM to warm up, so the LOGOS interpreter reaches first output in 2.3ms versus V8’s 14ms, about 6.0x quicker, which is what matters for short-lived work like cloud functions, CLI tools, and scripts. On long-running loops V8’s optimizing JIT pulls ahead: the interpreter is competitive on memory-bound work and behind on heavy compute, a geometric mean of 1.04x the speed of V8 across 30 benchmarks.
Engine size — the runtime you ship to execute a program (shorter ships less; stripped, code-only size in parentheses)
largo (LOGOS VM+JIT)
24.7 MB (19.3 MB stripped)
Node / V8
119.0 MB (102.1 MB stripped)
In the browser the whole LOGOS engine ships as a 11.6 MB WebAssembly bundle — the same VM+JIT, no native install. Node’s binary bundles V8, libuv, and ICU; largo bundles the transpiler, bytecode VM, and copy-and-patch JIT — each is the whole engine you ship to run a program. As-built is the real file; stripped removes debug symbols.
Recursive Fibonacci (engine: vm+jit)
Wall-clock time at n = 38 — shorter is faster. The interpreter runs at 1.11x the speed of V8 here.
LOGOS (eager)
185.3ms
Node / V8
205.5ms
LOGOS (tiered)
356.1ms
Source Code
The LOGOS source and the Rust it compiles to. Switch an optimization off and watch its “## No <X>” decorator appear on the LOGOS source — and the generated Rust recompile live in your browser. With every optimization on you see the cached release build; disabling them all yields plain, boring Rust.
analyzing which optimizations this program uses…
LOGOS
## To native args () -> Seq of Text ## To native parseInt (s: Text) -> Int ## To fib (n: Int) -> Int: If n is less than 2: Return n. Return fib(n - 1) + fib(n - 2). ## Main Let arguments be args(). Let n be parseInt(item 2 of arguments). Show fib(n).
Generated Rust
#[allow(unused_imports)] use std::fmt::Write as _; use logicaffeine_data::*; use logicaffeine_system::*; fn args() -> LogosSeq<String> { logicaffeine_system::env::args() } fn parseInt(s: String) -> i64 { logicaffeine_system::text::parseInt(s) } fn fib(n: i64) -> i64 { use std::cell::RefCell; thread_local! { static __MEMO_FIB: RefCell<FxHashMap<i64, i64>> = RefCell::new(FxHashMap::default()); } if let Some(__v) = __MEMO_FIB.with(|c| c.borrow().get(&n).copied()) { return __v; } let __memo_result = (|| -> i64 { if (n < 2) { return n; } return (fib(logos_sub_i64(n, 1)) + fib(logos_sub_i64(n, 2))); })(); __MEMO_FIB.with(|c| c.borrow_mut().insert(n, __memo_result)); __memo_result } fn main() { std::thread::Builder::new() .stack_size(67_108_864) .spawn(_logos_main) .unwrap().join().unwrap(); } fn _logos_main() { let arguments = args(); let n = parseInt(arguments.borrow()[1].clone()); show(&fib(n)); }
Cgcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0View on GitHub →
#include <stdio.h> #include <stdlib.h> long fib(long n) { if (n < 2) return n; return fib(n - 1) + fib(n - 2); } int main(int argc, char *argv[]) { if (argc < 2) { fprintf(stderr, "Usage: fib <n>\n"); return 1; } long n = atol(argv[1]); printf("%ld\n", fib(n)); return 0; }
C++g++ (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0View on GitHub →
#include <cstdio> #include <cstdlib> long fib(long n) { if (n < 2) return n; return fib(n - 1) + fib(n - 2); } int main(int argc, char *argv[]) { if (argc < 2) { fprintf(stderr, "Usage: fib <n>\n"); return 1; } long n = std::atol(argv[1]); printf("%ld\n", fib(n)); return 0; }
Rustrustc 1.96.0 (ac68faa20 2026-05-25)View on GitHub →
fn fib(n: i64) -> i64 { if n < 2 { return n; } fib(n - 1) + fib(n - 2) } fn main() { let n: i64 = std::env::args().nth(1).unwrap().parse().unwrap(); println!("{}", fib(n)); }
Zig0.15.2View on GitHub →
const std = @import("std"); fn fib(n: i64) i64 { if (n < 2) return n; return fib(n - 1) + fib(n - 2); } pub fn main() !void { var buf: [4096]u8 = undefined; var stdout = std.fs.File.stdout().writer(&buf); var args = std.process.args(); _ = args.skip(); const arg = args.next() orelse return; const n = try std.fmt.parseInt(i64, arg, 10); try stdout.interface.print("{}\n", .{fib(n)}); try stdout.interface.flush(); }
Gogo version go1.22.2 linux/amd64View on GitHub →
package main import ( "fmt" "os" "strconv" ) func fib(n int64) int64 { if n < 2 { return n } return fib(n-1) + fib(n-2) } func main() { n, _ := strconv.ParseInt(os.Args[1], 10, 64) fmt.Println(fib(n)) }
Javaopenjdk 21.0.11 2026-04-21View on GitHub →
public class Main { static long fib(long n) { if (n < 2) return n; return fib(n - 1) + fib(n - 2); } public static void main(String[] args) { long n = Long.parseLong(args[0]); System.out.println(fib(n)); } }
JavaScriptView on GitHub →
function fib(n) { if (n < 2) return n; return fib(n - 1) + fib(n - 2); } const n = parseInt(process.argv[2]); console.log(fib(n));
import sys def fib(n): if n < 2: return n return fib(n - 1) + fib(n - 2) n = int(sys.argv[1]) print(fib(n))
def fib(n) return n if n < 2 fib(n - 1) + fib(n - 2) end n = ARGV[0].to_i puts fib(n)
NimNim Compiler Version 2.0.4 [Linux: amd64]View on GitHub →
import os, strutils proc fib(n: int64): int64 = if n < 2: return n return fib(n - 1) + fib(n - 2) let n = parseInt(paramStr(1)).int64 echo fib(n)
Compilation Times
Time to compile each benchmark from source, at the same flags used for the runtime numbers. LOGOS compiles English to Rust, then invokes rustc at full optimization (-O3, fat LTO, target-cpu=native) — so its bar includes the Rust compile.
gcc -O3 -march=native -flto
64.3ms
g++ -O3 -march=native -flto
73.1ms
go build (release)
76.0ms
javac
177.2ms
zig build-exe -O ReleaseFast -mcpu native
201.9ms
nim c -d:release -march=native
293.3ms
rustc -O3 -C lto=fat -C target-cpu=native
1.41s
largo build (debug)
1.72s
largo build --release → rustc -O3 -C lto=fat -C codegen-units=1 -C target-cpu=native
10.68s
CompilerMeanStdDev
gcc -O3 -march=native -flto64.3ms±661µs
g++ -O3 -march=native -flto73.1ms±5.5ms
go build (release)76.0ms±3.7ms
javac177.2ms±6.4ms
zig build-exe -O ReleaseFast -mcpu native201.9ms±1.2ms
nim c -d:release -march=native293.3ms±4.5ms
rustc -O3 -C lto=fat -C target-cpu=native1.41s±7.2ms
largo build (debug)1.72s±27.5ms
largo build --release → rustc -O3 -C lto=fat -C codegen-units=1 -C target-cpu=native10.68s±32.7ms
Cross-Benchmark Summary
Geometric-mean speed vs C across all 32 benchmarks (bars proportional to speed; higher is faster).
LOGOS
2.62x
Rust
1.25x
Zig
1.21x
C++
1.03x
C
1.00x
Go
0.73x
Java
0.65x
Nim
0.65x
  • Each benchmark measured with hyperfine (10 runs, 2 warmup); the bars show the median.
  • CPU: Intel(R) Core(TM) i9-14900K.
  • OS: Ubuntu 24.04.2 LTS x86_64.
  • Every implementation runs the same algorithm and produces identical, verified output.
  • All compiled languages are built at full, matched optimization (see flags below) — no language is handicapped relative to LOGOS.
  • Two geometric means are reported vs C: the headline keeps all 32 benchmarks; the apples-to-apples figure removes the 5 where the LOGOS compiler collapses the algorithm (⚡). Every collapse is auditable in the generated Rust per benchmark.
  • The Interpreter-vs-V8 section is a separate peer comparison (LOGOS bytecode VM + JIT against Node/V8) at interpreter-calibrated sizes, so its n differs from the compiled section.

Compiler Versions

LanguageVersion
Otherv22.22.3
Rustrustc 1.96.0 (ac68faa20 2026-05-25)
Gogo version go1.22.2 linux/amd64
NimNim Compiler Version 2.0.4 [Linux: amd64]
Javaopenjdk 21.0.11 2026-04-21
Cgcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
C++g++ (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
Zig0.15.2

Compiler Flags

LanguageFlags
Cgcc -O3 -march=native -flto -lm
C++g++ -O3 -march=native -flto -std=c++17
Rustrustc --edition 2021 -C opt-level=3 -C lto=fat -C codegen-units=1 -C target-cpu=native
Zigzig build-exe -O ReleaseFast -mcpu native
Gogo build (Go has no -O levels; this is its optimizing release build)
Javajavac, run on the HotSpot JIT
Nimnim c -d:release --passC:"-O3 -march=native"
JavaScriptnode (V8 JIT)
LOGOSlargo build --release → generated Rust → rustc -C opt-level=3 -C lto=fat -C codegen-units=1 -C target-cpu=native
LOGOS (interpreted)largo run --interpret (bytecode VM + copy-and-patch JIT)

Links