Performance Benchmarks
SP is engineered from the ground up for high-performance computing. We rigorously test SP against leading systems and application languages to ensure exceptional raw runtime execution and memory efficiency.
Hardware & Test Environment
Recursive Fibonacci (n=40)
Evaluates function call overhead, stack frame management, and recursion speed without caching.
| Language | Compiler / Runtime | Execution Time (ms) | Peak Memory (MB) | Speedup vs Python | SP Relative Speed |
|---|---|---|---|---|---|
| SPSP Target | spc -O3 | 312 ms | 14.2 MB | 62.5x | 1.00x (Baseline) |
| C | gcc -O3 | 304 ms | 2.1 MB | 64.1x | 0.97x faster |
| C++ | clang++ -O3 | 308 ms | 3.4 MB | 63.3x | 0.99x faster |
| Rust | rustc --release | 318 ms | 4.2 MB | 61.3x | 1.02x slower |
| Java | OpenJDK 21 (HotSpot) | 512 ms | 48 MB | 38.1x | 1.64x slower |
| Node.js | Node.js v20 (V8) | 980 ms | 38.5 MB | 19.9x | 3.14x slower |
| Python | CPython 3.12 | 19500 ms | 16 MB | 1.0x | 62.50x slower |
Quicksort (1,000,000 Elements)
Evaluates raw memory throughput, branch prediction, array indexing, and in-place swapping.
| Language | Compiler / Runtime | Execution Time (ms) | Peak Memory (MB) | Speedup vs Python | SP Relative Speed |
|---|---|---|---|---|---|
| SPSP Target | spc -O3 | 82 ms | 22 MB | 29.3x | 1.00x (Baseline) |
| C | gcc -O3 | 78 ms | 12 MB | 30.8x | 0.95x faster |
| C++ | clang++ -O3 | 79 ms | 12.5 MB | 30.4x | 0.96x faster |
| Rust | rustc --release | 84 ms | 13 MB | 28.6x | 1.02x slower |
| Java | OpenJDK 21 (HotSpot) | 142 ms | 72 MB | 16.9x | 1.73x slower |
| Node.js | Node.js v20 (V8) | 240 ms | 68 MB | 10.0x | 2.93x slower |
| Python | CPython 3.12 | 2400 ms | 45 MB | 1.0x | 29.27x slower |
Hash Map (1,000,000 Insert & Lookup)
Evaluates hash collision handling, dynamic bucket resizing, pointer dereferencing, and allocator throughput.
| Language | Compiler / Runtime | Execution Time (ms) | Peak Memory (MB) | Speedup vs Python | SP Relative Speed |
|---|---|---|---|---|---|
| SPSP Target | spc -O3 | 185 ms | 48 MB | 7.7x | 1.00x (Baseline) |
| C | gcc -O3 | 162 ms | 36 MB | 8.8x | 0.88x faster |
| C++ | clang++ -O3 | 170 ms | 38 MB | 8.4x | 0.92x faster |
| Rust | rustc --release | 178 ms | 42 MB | 8.0x | 0.96x faster |
| Java | OpenJDK 21 (HotSpot) | 295 ms | 128 MB | 4.8x | 1.59x slower |
| Node.js | Node.js v20 (V8) | 460 ms | 110 MB | 3.1x | 2.49x slower |
| Python | CPython 3.12 | 1420 ms | 95 MB | 1.0x | 7.68x slower |
Binary Trees (Depth 16)
Classic GC/allocator benchmark allocating, traversing, and deallocating deep recursive trees.
| Language | Compiler / Runtime | Execution Time (ms) | Peak Memory (MB) | Speedup vs Python | SP Relative Speed |
|---|---|---|---|---|---|
| SPSP Target | spc -O3 | 410 ms | 64 MB | 11.7x | 1.00x (Baseline) |
| C | gcc -O3 | 345 ms | 44 MB | 13.9x | 0.84x faster |
| C++ | clang++ -O3 | 360 ms | 46 MB | 13.3x | 0.88x faster |
| Rust | rustc --release | 395 ms | 48 MB | 12.2x | 0.96x faster |
| Java | OpenJDK 21 (HotSpot) | 580 ms | 210 MB | 8.3x | 1.41x slower |
| Node.js | Node.js v20 (V8) | 820 ms | 195 MB | 5.9x | 2.00x slower |
| Python | CPython 3.12 | 4800 ms | 130 MB | 1.0x | 11.71x slower |
Mandelbrot (1,000 x 1,000 Fractal)
Evaluates double-precision floating point math, SIMD vectorization potential, and tight computational loops.
| Language | Compiler / Runtime | Execution Time (ms) | Peak Memory (MB) | Speedup vs Python | SP Relative Speed |
|---|---|---|---|---|---|
| SPSP Target | spc -O3 | 245 ms | 16 MB | 33.5x | 1.00x (Baseline) |
| C | gcc -O3 | 232 ms | 2.8 MB | 35.3x | 0.95x faster |
| C++ | clang++ -O3 | 236 ms | 3.6 MB | 34.7x | 0.96x faster |
| Rust | rustc --release | 240 ms | 4.8 MB | 34.2x | 0.98x faster |
| Java | OpenJDK 21 (HotSpot) | 390 ms | 52 MB | 21.0x | 1.59x slower |
| Node.js | Node.js v20 (V8) | 650 ms | 42 MB | 12.6x | 2.65x slower |
| Python | CPython 3.12 | 8200 ms | 18 MB | 1.0x | 33.47x slower |
Reproducing Benchmarks Locally
All benchmark source files in SP, C, C++, Rust, Java, Node.js, and Python are open-source and included in the repository under benchmarks/. You can run the entire automated benchmarking suite with:
git clone https://github.com/shantopaul/SP-Language.git cd SP-Language python benchmarks/run_benchmarks.py --all --iterations 10
The runner will automatically compile all source variants with highest optimization flags, warm up memory caches, and output structured latency percentiles (P50, P90, P99).