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
Allocation and ownership
The cost of the single-owner heap: allocating a small object with heap and dropping it at scope end, churn with one and ten objects live, transferring ownership with # down a chain of calls, the live-allocation set on and off, arrays, and struct values that never touch the heap. The memory tab of every chart shows allocated bytes, and for the live-set rows the chart shows the same program under --live-set=on and --live-set=off.
Benchmarks
| id | workload | against | check |
|---|---|---|---|
lang/alloc-small-object | 1e7 heap allocations of a 32-byte object, each dropped at scope end | C++ new/delete and make_unique, Rust Box, Go, Java, Python | count |
lang/alloc-churn-1 | 1e7 allocations with one object live at a time | same | count |
lang/alloc-churn-10 | 1e7 allocations with ten live, oldest dropped | same | count |
lang/alloc-transfer-chain | 1e6 objects passed with # through ten calls and dropped at the end | C++ std::move of unique_ptr, Rust move, Go, Java, Python | count |
lang/alloc-live-set-on | alloc-small-object with the live-allocation set on | Cajeta only (the two compiler modes) | count |
lang/alloc-live-set-off | alloc-small-object with the live-allocation set off | Cajeta only | count |
lang/alloc-array | 1e5 allocations of an int32[1024] | C++, Rust, Go, Java, Python | sum of first elements |
lang/alloc-struct-value | 1e8 struct values constructed and read on the stack | C++, Rust, Go, Java record, Python | sum |
The ownership model is the load-bearing design of the language; read the memory model before reading these numbers. Java and Go rows include their collectors’ work in the measured window; the allocation-bytes metric is the one that compares runtimes on equal terms.
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 alloc-small-object # Cajeta
./bench.sh --bench alloc-small-object --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/