Performance
On these workloads Kon runs about level with C, with bounds checks kept on. These are five small programs on one machine, and they do not rank the languages in general.
Against C and Rust
Same algorithm and same checksum in each language; every program checks that it got the right answer. Times are in milliseconds, and lower is better.
C's sieve measured 151 to 208 ms across sessions, so that row's gap is within noise. List access is compiled inline, with its bounds check kept, and that is most of why these are close.
kon build without --release is unoptimized and runs 1.9 to 6.9 times slower.
Floating point
An early measurement, against C only and on an earlier compiler:
| Workload | Kon (ms) | C (ms) |
|---|---|---|
| matrix | 58 | 53 |
| nbody | 97 | 86 |
| mandelbrot | 154 | about 156 |
Library
| Workload | Kon library | Rust std | C qsort |
|---|---|---|---|
| Map, 100,000 keys | 9 ms | 4 ms | |
| Sort, 5 million integers | 156 ms | 90 ms | 597 ms |
A size-class allocator also took a program of many small lists from 201 ms to 35 ms on Windows, and is now the default.
Program size
A simple program is about 90 KB. On the same workload C was about 64 KB and Rust about 4.9 MB, not stripped.
What we learned
- Inlining mattered most. Calling into the runtime for each list access cost about 2.8 times C; compiling it inline brought that to about 1.0, with bounds checks kept.
- AVX2 gave nothing on these programs. Compiling for newer CPUs did not speed them up, in Kon, C or Rust.
- Arenas are less of a win than they look. They kept a clear lead only on trees, about 3.4 times; a good allocator gets most of the rest with no analysis.
- Column layout can help and hurt. Storing a list by field was up to 5.8 times faster when a loop touches few fields, and 4.5 times slower on random reads of whole rows, measured by hand in C. So if Kon gets it, the writer will choose, not the compiler.
Method
Intel Core Ultra 5 225H, Windows 11, one process pinned to one core. Fastest of 7 runs, minus the launcher overhead measured with an empty program. Clang 23.1.4 with -O2 and Rust 1.99.1 with opt-level=2, measured in October 2026.
Not measured
- Compile time.
- Large, real programs.
- Any other machine or operating system.
- Whether bounds checks limit vectorization.