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
Exceptions
What a try costs when nothing is thrown, what a throw costs when it is caught one frame up, and how that scales through ten and a hundred frames. RecoverableException and UnrecoverableException are measured separately, and one row throws inside a fiber. Rust and Go have no exceptions, so their rows propagate a Result or an error through the same call depth and say so in the row’s notes.
Benchmarks
| id | workload | against | check |
|---|---|---|---|
lang/try-no-throw | 1e8 calls through a try that never throws | C++, Java, Python; Rust and Go: a Result/error return | sum |
lang/throw-catch-1 | 1e6 throw-and-catch across one frame | C++, Java (with and without stack trace), Python; Rust Err, Go error | count caught |
lang/throw-catch-10 | 1e6 throws unwinding ten frames | same | count caught |
lang/throw-catch-100 | 1e5 throws unwinding a hundred frames | same | count caught |
lang/throw-recoverable | RecoverableException against UnrecoverableException, 1e6 each | Java checked and unchecked | count caught |
lang/throw-in-fiber | 1e5 throws caught inside a spawned fiber | Java virtual thread, Go goroutine, Python asyncio task | count caught |
The error model is documented in the guide’s error handling chapter.
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.
Reproduce
cd bench
./bench.sh --bench try-no-throw # Cajeta
./bench.sh --bench try-no-throw --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/