Inspired by the blog post Nature vs Golang: Performance Benchmarking.
One of the most common questions we get asked is: "How fast is Kit compared to [insert favorite language]?" It's a fair question. Performance matters, especially when you're choosing a language for production systems, compute-intensive tasks, or just want to know what you're getting into.
We decided to put Kit through its paces alongside some of the most popular compiled and interpreted languages: Go, Rust, Zig, V, Crystal, Nim, Node.js, Python, and Ruby. The results were encouraging.
A Note on Benchmarks
Benchmarking is tricky business. Results vary based on hardware, OS, compiler versions, and how idiomatic the code is for each language. These numbers give you a general sense of performance characteristics, but they're not definitive proof that one language is universally "faster" than another.
We encourage you to run these benchmarks yourself. The full source code is available in our kit-benchmarks repository.
Test Environment
- Device: Mac mini
- CPU: Intel Core i7-8700B @ 3.20GHz (6 cores)
- Memory: 64 GB
- OS: macOS 15.7.3
Fibonacci Recursion
The classic recursive Fibonacci calculation is a great test of function call overhead and recursion
performance. We calculated fib(45) across all languages—that's over 2 billion function
calls for languages that don't optimize tail recursion.
The Results
| Language | Mean Time | vs Kit |
|---|---|---|
| Kit | 3.85s | 1.0x (fastest) |
| V | 4.82s | 1.25x slower |
| Zig | 5.08s | 1.32x slower |
| Rust | 6.66s | 1.73x slower |
| Crystal | 7.49s | 1.95x slower |
| Go | 7.84s | 2.04x slower |
| Nim | 16.96s | 4.40x slower |
| Node.js | 17.10s | 4.44x slower |
| Ruby | 99.32s | 25.80x slower |
| Python | 255.45s | 66.35x slower |
Kit came out on top here, completing the calculation in just 3.85 seconds. That's faster than Zig (which Kit compiles to), faster than Rust, and more than twice as fast as Go. The JIT-compiled languages like Node.js took considerably longer, while interpreted languages like Python and Ruby were orders of magnitude slower.
Pi Calculation
For our second benchmark, we calculated pi using the Leibniz series with 100 million iterations. This test stresses floating-point arithmetic and loop performance, with bonus points for languages that optimize tail recursion.
The Results
| Language | Mean Time | vs Zig |
|---|---|---|
| Zig | 0.10s | 1.0x (baseline) |
| Kit | 0.10s | 1.0x (matching Zig) |
| Rust | 0.10s | ~1.0x |
| Go | 0.15s | ~1.5x slower |
| V | 2.0s | ~20x slower |
| Nim | 3.6s | ~36x slower |
| Crystal | 5.7s | ~57x slower |
| Python | 10.0s | ~100x slower |
| Node.js | 10.5s | ~105x slower |
| Ruby | 24.0s | ~240x slower |
In this test, Kit matched Zig and Rust at the top of the leaderboard, all completing in around 100 milliseconds. This makes sense—Kit compiles to Zig, so for tight numerical loops, you're essentially running optimized Zig code. Go came in slightly behind, while V, Nim, and Crystal showed that their floating-point paths have room for optimization.
Key Takeaways
- Kit is fast. In recursive workloads, Kit outperformed every language we tested, including systems languages like Zig and Rust.
- Numerical performance matches Zig. For compute-heavy code, Kit delivers the same performance as its compilation target.
- Functional doesn't mean slow. Kit proves that a functional language with immutable data structures can compete with (and beat) imperative languages.
- Your mileage may vary. Different workloads will show different characteristics. Run the benchmarks yourself to see how Kit performs for your use case.
Try It Yourself
Want to run these benchmarks on your own hardware? Clone the repository and give it a spin:
git clone https://gitlab.com/kit-lang/kit-benchmarks.git
cd kit-benchmarks
./run-benchmarks.sh
We'd love to hear your results, especially on different hardware configurations. Share them with us on @KitLangOrg or @Kit_Lang, or open an issue in the repository.