Benchmarks
41 whole programs, each written in Kavach, C++ and often Python, Go or C#, run on one machine. Kavach is faster than C++ in 31 of 36 of them, and the others are here too.
How these are measured
- The same algorithm in every language, written the way a fluent programmer would.
- Whole programs, start to finish, on the same machine; the best of several runs.
- Every number is read from the benchmark's README, where each run is recorded, never typed into this page.
- Each suite ends with one command to run it yourself.
- In a race, every bar fills at the same speed: milliseconds to scale, so the first to finish is the fastest.
The machine
Every suite here ran on one laptop, unless its README says otherwise.
| CPU | Intel Core i7-13700HX: 16 cores (8 fast, 8 efficient), 24 threads |
| Memory | 32 GB DDR5-4800 (two 16 GB modules); WSL gets 15.6 GB of it |
| GPU | NVIDIA GeForce RTX 4050 Laptop GPU, 6 GB (and the CPU's Intel UHD Graphics) |
| Windows | Windows 11 Home 10.0.26300, power plan Balanced, on mains power |
| Linux | WSL 2 on the same machine: Ubuntu 24.04, kernel 5.15.167.4-microsoft-standard-WSL2 |
Loops, calls and lists
WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · Go 1.23 · .NET 8 (C# start-up included) · best of 9 · measured 2026-11-11 · how Kavach does it: Loops on all cores
loop — 500M rounds of modular arithmetic · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · Go 1.23 · .NET 8 (C# start-up included) · best of 9
sort — 5M integers · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · Go 1.23 · .NET 8 (C# start-up included) · best of 9
lists — build, read, change and sum 10M items · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · Go 1.23 · .NET 8 (C# start-up included) · best of 9
text — build, split and search large text · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · Go 1.23 · .NET 8 (C# start-up included) · best of 9
sizedmaps — 2M keys into a map told its size (C++ reserves too) · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · Go 1.23 · .NET 8 (C# start-up included) · best of 9
git clone https://github.com/Mithlesh04/kavach && cd kavach
sh scripts/run-benchmarks.sh "" benchmarks/loopsMath on large data
WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · best of 9 · measured 2026-11-09 · how Kavach does it: Loops on all cores
sum — 50 million integers, 10 times, every addition overflow-checked · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · best of 9
scale — y = x * 2.5 + 1.0 over 20 million floats, 10 times · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · best of 9
roots — sqrt over 20 million floats, 10 times · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · best of 9
dot — the dot product of two 20-million-float lists, 10 times · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · best of 9
git clone https://github.com/Mithlesh04/kavach && cd kavach
sh scripts/run-benchmarks.sh "" benchmarks/mathMethod chains
WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · Python 3.12 · best of 9 · measured 2026-11-09 · how Kavach does it: Method chains
datachain — map, filter, map, sum over 10 million items · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · Python 3.12 · best of 9
builderchain — five chained builder calls, 10 million times · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · Python 3.12 · best of 9
nestedchain — a chain inside a chain, ten thousand rows · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · Python 3.12 · best of 9
git clone https://github.com/Mithlesh04/kavach && cd kavach
sh scripts/run-benchmarks.sh "" benchmarks/chainsEveryday operations
WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · best of 9 · measured 2026-11-09 · how Kavach does it: Functions as values
alloc — a short-lived list made, read and freed 20 million times · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · best of 9
callbacks — a callback held in a record, called 100 million times · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · best of 9
nested — fifty handlers each wrapping the next, 100 million hops · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · best of 9
copies — a record copied, changed and read 100 million times · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · best of 9
branches — an if/else chain decided 200 million times · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · best of 9
stacks — recursion 100 thousand frames deep, a thousand times · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · best of 9
git clone https://github.com/Mithlesh04/kavach && cd kavach
sh scripts/run-benchmarks.sh "" benchmarks/everydaySingle reads, large data
WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · Python 3.12 · best of 9 (Python best of 3) · measured 2026-11-09 · how Kavach does it: Maps
dict — 20M random reads from a 2M-entry map · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · Python 3.12 · best of 9 (Python best of 3)
index — 50M random reads from a 10M-item list · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · Python 3.12 · best of 9 (Python best of 3)
git clone https://github.com/Mithlesh04/kavach && cd kavach
sh scripts/run-benchmarks.sh "" benchmarks/lookupsAs data grows
WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · Python 3.12 · best of 9 (Python best of 3) · measured 2026-11-09 · how Kavach does it: As data grows
index — 50M random reads from a list of 1,000 items · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · Python 3.12 · best of 9 (Python best of 3)
index — 50M random reads from a list of 1,000,000 items · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · Python 3.12 · best of 9 (Python best of 3)
index — 50M random reads from a list of 10,000,000 items · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · Python 3.12 · best of 9 (Python best of 3)
index — 50M random reads from a list of 100,000,000 items · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · Python 3.12 · best of 9 (Python best of 3)
sort — 1,000 integers · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · Python 3.12 · best of 9 (Python best of 3)
sort — 1,000,000 integers · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · Python 3.12 · best of 9 (Python best of 3)
sort — 10,000,000 integers · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · Python 3.12 · best of 9 (Python best of 3)
sort — 100,000,000 integers · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · Python 3.12 · best of 9 (Python best of 3)
git clone https://github.com/Mithlesh04/kavach && cd kavach
sh scripts/run-benchmarks.sh "" benchmarks/sizesJSON on large data
WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · Python 3.12 (its json module is C) · typical of 5 runs · measured 2026-11-11 · how Kavach does it: JSON
300,000 orders (52 MB): write, parse, read, decode · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · Python 3.12 (its json module is C) · typical of 5 runs
stringify — every order to JSON text · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · Python 3.12 (its json module is C) · typical of 5 runs
parse — the text back into dynamic values · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · Python 3.12 (its json module is C) · typical of 5 runs
read — qty and price of 1.5M items from parsed values · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · Python 3.12 (its json module is C) · typical of 5 runs
decode — the text straight into records · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · Python 3.12 (its json module is C) · typical of 5 runs
git clone https://github.com/Mithlesh04/kavach && cd kavach
kavach build benchmarks/json/kavach/json.kav && ./json; python3 benchmarks/json/python/json_bench.pyRaw bytes
WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · best of 9 · measured 2026-11-09 · how Kavach does it: Byte-packed lists
crc — build 64 MB byte by byte, checksum it (CRC32C) · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · best of 9
git clone https://github.com/Mithlesh04/kavach && cd kavach
sh scripts/run-benchmarks.sh "" benchmarks/bytesTasks on all cores
WSL Ubuntu 24.04 · i7-13700HX (8 fast cores) · kavach build (LLVM) · g++ 13 -O2 · best of 3 rounds of 3 runs · measured 2026-11-10 · how Kavach does it: Tasks
parallel_map: eight sums of 150M rounds each, one task each · WSL Ubuntu 24.04 · i7-13700HX (8 fast cores) · kavach build (LLVM) · g++ 13 -O2 · best of 3 rounds of 3 runs
map: the same eight sums, one after another · WSL Ubuntu 24.04 · i7-13700HX (8 fast cores) · kavach build (LLVM) · g++ 13 -O2 · best of 3 rounds of 3 runs
git clone https://github.com/Mithlesh04/kavach && cd kavach
kavach build benchmarks/tasks/kavach/parallel-map.kav && ./parallel-mapChannels
WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · Python 3.12 · best of 9 (Python best of 3) · measured 2026-11-09 · how Kavach does it: Channels
pipe — 2M integers from one task to another, capacity 1024 · WSL Ubuntu 24.04 · i7-13700HX · kavach build (LLVM) · g++ 13 -O2 · Python 3.12 · best of 9 (Python best of 3)
git clone https://github.com/Mithlesh04/kavach && cd kavach
sh scripts/run-benchmarks.sh "" benchmarks/channelsNetwork waits
WSL Ubuntu 24.04 · i7-13700HX · g++ 13 -O2 · Python 3.12 · measured 2026-11-03 · how Kavach does it: HTTP
pingpong — 10,000 TCP round trips between two tasks (Linux) · WSL Ubuntu 24.04 · i7-13700HX · g++ 13 -O2 · Python 3.12
git clone https://github.com/Mithlesh04/kavach && cd kavach
sh scripts/run-benchmarks.sh "" benchmarks/netMany network clients
WSL Ubuntu 24.04 · i7-13700HX · g++ 13 -O2 · measured 2026-11-03 · how Kavach does it: Tasks
clients — an echo server with 100 clients, 1,000 round trips each · WSL Ubuntu 24.04 · i7-13700HX · g++ 13 -O2
git clone https://github.com/Mithlesh04/kavach && cd kavach
sh scripts/run-benchmarks.sh "" benchmarks/netOn the GPU
Windows 11 · i7-13700HX · RTX 4050 Laptop · g++ -O3 -march=native -fopenmp for 24 threads · how Kavach does it: On the GPU
glow, first map — 4 million Float32 items, 1,000 steps each, sent to the GPU · Windows 11 · i7-13700HX · RTX 4050 Laptop · g++ -O3 -march=native -fopenmp for 24 threads
glow, second map — the same list, already in GPU memory · Windows 11 · i7-13700HX · RTX 4050 Laptop · g++ -O3 -march=native -fopenmp for 24 threads
git clone https://github.com/Mithlesh04/kavach && cd kavach
sh scripts/run-benchmarks.sh "" benchmarks/gpu