Testing the performance of some languages and enviroments using the Sieve of Eratosthenes algorithm
Position | Language | Version | Medium | Lowest | Highest |
---|---|---|---|---|---|
1 | Rust | 1.75.0 | 0.271s | 0.263s | 0.278s |
2 | Zig | 0.11.0 | 0.275s | 0.273s | 0.280s |
3 | Go | 1.21.6 | 0.331s | 0.298s | 0.331s |
4 | .Net C# | 8.0.101 | 0.333s | 0.322s | 0.349s |
5 | Bun | 1.0.14 | 0.884s | 0.874s | 0.891s |
6 | Python | 3.11.6 | 4.5s | 4.390s | 4.601s |
7 | Node | 20.11.0 | 6.593s | 6.559s | 6.651s |
8 | Deno | 1.40.3 | N/A | N/A | N/A |
cargo build --release
time ./target/release/rust
- 0.271s
- 0.263s
- 0.278s
Medium: 0.271s
go build -ldflags="-s -w" ./main.go
time ./main
- 0.304s
- 0.331s
- 0.298s
Medium: 0.331s
zig build -Doptimize=ReleaseFast
time ./zig-out/bin/zig
- 0.273s
- 0.273s
- 0.280s
Medium: 0.275s
time python main.py
- 4.390s
- 4.509s
- 4.601s
Medium: 4.5s
time node main.js
- 6.559s
- 6.569s
- 6.651s
Medium: 6.593s
time deno run main.js
Could not be tested
time bun run main.js
- 0.874s
- 0.887s
- 0.891s
Medium: 0.884s
dotnet build --configuration Release
time ./bin/Release/net8.0/dotnet
- 0.349s
- 0.322s
- 0.328s
Medium: 0.333s