docs / benchmarks / lang
Benchmarks index
aot
codec
codec / csv
codec / json
collection
- Overview
- ArrayList
- BPlusTree
- Cache
- Collectors
- HashMap
- HashSet
- Heap
- ImmutableList
- ImmutableMap
- ImmutableSet
- LinkedList
- RedBlackTree
- Sort
collection / ltm
concurrent
gfx
hash
http
io
io / file
io / net
io / net / uri
lang
- Overview
- Allocation and ownership
- Calls and dispatch
- Exceptions
- Guid
- Loops
- Math and SIMD
- Optional
- Pair
- Slice
- String
- StringBuilder
- Whole programs: the Benchmarks Game
lang / stream
llm
math
math / fft
math / linalg
math / npio
math / poly
math / random
math / stats
ml
nucleo
primavera
process
reflect
search
search / distance
search / fuzzy
search / ngram
time
toolchain
toolchain / kernel-startup
wire
xpu
xpu / mesh
Loops
The language’s loops, measured bare: a counted for, the same loop with bounds checks off, nested loops, foreach over an array and over an ArrayList, a range, a loop-carried reduction and an early exit. These are the floors every other number on this site stands on. Each loop consumes its result through the harness sink so the optimizer cannot delete it, and the smoke test greps the release IR to confirm the loop survived.
Benchmarks
| id | workload | against | check |
|---|---|---|---|
lang/loop-counted | 1e8 iterations summing i into an int64 | C++, Rust, Go, Java, Python | sum |
lang/loop-counted-nobounds | the same loop indexing an array with --bounds=off | C++, Rust (get_unchecked), Go, Java | sum |
lang/loop-nested | 1e4 × 1e4 nested counted loops | C++, Rust, Go, Java, Python | sum |
lang/loop-foreach-array | foreach over an int32[] of 1e7 | C++, Rust, Go, Java, Python | sum |
lang/loop-foreach-arraylist | walk an ArrayList<int32> of 1e7 by index (foreach over an ArrayList runs zero iterations on v0.46.3, a filed defect; the row moves to foreach when fixed) | C++, Rust, Go, Java, Python | sum |
lang/loop-range | a counted for over [lo, hi) of 1e8 (the language has no range construct; the competitors use theirs) | C++, Rust, Go, Java, Python | sum |
lang/loop-reduce | loop-carried float64 reduction over 1e7 | C++, Rust, Go, Java, Python | sum within epsilon |
lang/loop-early-exit | scan of 1e7 for a sentinel at the midpoint, 1e3 times | C++, Rust, Go, Java, Python | index found |
The language has no loop construct a competitor lacks, so every row is the same shape in every language.
Results
One chart per benchmark, for the machine selected at the top of the page. Languages are the bars, best first; Cajeta’s bar is in color and the competitors’ are gray. A skipped competitor keeps its row with the reason in place of a bar. A benchmark with no row on the selected machine says so and shows nothing else.
Not yet measured on Proton.
Not yet measured on Proton.
Not yet measured on Proton.
Not yet measured on Proton.
Not yet measured on Proton.
Not yet measured on Proton.
Not yet measured on Proton.
Not yet measured on Proton.
Reproduce
cd bench
./bench.sh --bench loop-counted # Cajeta
./bench.sh --bench loop-counted --competitors # every pinned competitor
Every row records the compiler and competitor versions, flags, machine, OS and driver; METHODOLOGY states the rules a number must satisfy before it is published.
See also
- Benchmark source:
bench/src/main/cajeta/bench/lang/