PHP 8.5 vs Node.js vs Go vs Python: CPU Performance Benchmark (2026)

Introduction

PHP has long carried the reputation of being “slow,” especially when compared to compiled languages like Go or the V8-powered Node.js. But with PHP 8.5’s JIT (Just-In-Time) compilation, is that reputation still deserved?

In this benchmark, we put four popular languages head‑to‑head on a CPU‑intensive task: recursive Fibonacci calculation and a 1,000,000‑iteration math loop. We test:

  • PHP 8.5.2 (both JIT off and JIT on)
  • Node.js 22.22.0 (V8 JIT enabled)
  • Go 1.23.4 (compiled)
  • Python 3.12.3 (interpreted)

All tests run on the same server, with identical workloads, to answer one question: Where does PHP 8.5 with JIT really stand?


Test Environment

ComponentSpecification
CPUIntel Xeon Platinum (4 vCores)
RAM8 GB ECC
OSUbuntu 24.04 LTS
Web ServerNginx 1.24 (PHP only)
Test ToolApache Bench (ab)
Concurrency1 (single request at a time)
Requests per Run1,000
Warm‑up500 requests before each run

Test Script

All languages executed the same algorithm:

python

# Recursive Fibonacci (n=30)
def fibonacci(n):
    if n <= 1:
        return n
    return fibonacci(n-1) + fibonacci(n-2)
# 1,000,000 iterations of math operations
for i in range(1000000):
    result += math.sqrt(i) * math.sin(i)

Each HTTP endpoint returned a fixed "OK" string to ensure stable ab testing.


Results

Table 1: Raw Benchmark Data (Requests per second)

Test RunPHP 8.5 (JIT off)PHP 8.5 (JIT on)Node.js 22Go 1.23Python 3.12
Run 114.3323.0537.6866.504.72
Run 214.3323.0637.3466.634.72
Run 314.3123.0937.6766.364.72
Run 414.3123.0538.2667.664.72
Run 514.3523.0838.2068.614.72
Average14.3323.0737.8367.154.72

All runs completed with 0 failed requests. Results were highly stable with minimal variance.

Table 2: Response Time Comparison (milliseconds)

LanguageAvg Response TimeRelative to PHP (JIT on)
Go 1.2314.90 ms2.9x faster
Node.js 2226.44 ms1.6x faster
PHP 8.5 (JIT on)43.35 msbaseline
PHP 8.5 (JIT off)69.80 ms1.6x slower
Python 3.12211.85 ms4.9x slower

Table 3: Performance Summary

LanguageConfigurationreq/sRelative to PHP (JIT on)
Go 1.23Compiled67.152.91x
Node.js 22V8 JIT37.831.64x
PHP 8.5JIT enabled23.071.00x
PHP 8.5JIT disabled14.330.62x
Python 3.12Interpreter4.720.20x

Analysis

The JIT Effect: PHP’s 61% Leap

The most dramatic finding is the impact of JIT on PHP 8.5:

Configurationreq/sImprovement
JIT disabled14.33baseline
JIT enabled23.07+61%

This 61% boost confirms our earlier JIT benchmarks: for CPU‑intensive tasks, JIT is transformative. Without it, PHP trails far behind; with it, PHP becomes genuinely competitive.

Where Does PHP Stand?

With JIT enabled, PHP achieves:

  • 61% of Node.js performance (23.07 vs 37.83 req/s)
  • 34% of Go performance (23.07 vs 67.15 req/s)
  • 4.9x faster than Python (23.07 vs 4.72 req/s)

The gap between PHP and Node.js is now 1.6x – a far cry from the 2-3x differences often cited in older benchmarks.

Go Remains the Performance King

Go’s 67.15 req/s is the clear winner, demonstrating why it’s the language of choice for high‑performance systems. Its compiled nature and efficient runtime handle recursion and loops with minimal overhead.

Node.js: Strong but Surpassed by Go

Node.js’s V8 engine delivers impressive 37.83 req/s – 1.6x faster than PHP JIT. The V8 JIT has been optimized for over a decade, and it shows in recursive workloads.

Python: Expected but Stark

Python’s 4.72 req/s (4.9x slower than PHP) is expected for an interpreted language in CPU‑bound scenarios. Python excels at I/O and rapid development, not number‑crunching.


Should You Switch Languages?

The answer depends on your priorities:

PriorityRecommendation
Maximum performanceGo is the undisputed leader – 2.9x faster than PHP JIT
Good performance + ecosystemPHP 8.5 with JIT delivers solid performance (61% of Node.js) with a massive ecosystem
I/O‑bound applicationsNode.js remains excellent for async workloads
Rapid prototypingPython is still king, but accept the performance trade‑off

Key Takeaway for PHP Developers

Enable JIT. The 61% boost alone is reason enough. PHP 8.5 with JIT is no longer a performance outlier – it sits firmly between Node.js and Python, closing the gap with modern runtimes.

For teams already invested in PHP, this benchmark shows that you don’t need to switch languages for performance. With JIT enabled, PHP is competitive for CPU‑intensive tasks.


Frequently Asked Questions

Q: Why does Node.js still beat PHP with JIT?

A: V8’s JIT has been refined for over 15 years. PHP’s JIT, introduced in PHP 8.0, is still maturing. The gap will likely narrow in future versions.

Q: Why not test with higher concurrency?

A: This benchmark focuses on raw CPU performance per request. Higher concurrency would introduce process‑pool and scheduling variables, making it harder to isolate language performance.

Q: Would PHP be faster with a different test script?

A: Possibly. This test emphasizes recursion, which is a known strength of V8. Different workloads (e.g., array manipulation, object creation) may show different rankings.

Q: What about memory usage?

A: All languages used similar memory (2-5 MB) for this test. Memory wasn’t a differentiator.


Test Scripts (for Reproducibility)

Important: Run these commands only on your own isolated test server.

PHP Test Route (routes/web.php for Laravel)

php

Route::get('/cpu-test', function () {
    function fibonacci($n) {
        if ($n <= 1) return $n;
        return fibonacci($n-1) + fibonacci($n-2);
    }
    
    function loopTest($iterations) {
        $result = 0;
        for ($i = 0; $i < $iterations; $i++) {
            $result += sqrt($i) * sin($i);
        }
        return $result;
    }
    
    fibonacci(30);
    loopTest(1000000);
    return response('OK');
});

Node.js Test Server

javascript

const http = require('http');
function fibonacci(n) {
    if (n <= 1) return n;
    return fibonacci(n-1) + fibonacci(n-2);
}
function loopTest(iterations) {
    let result = 0;
    for (let i = 0; i < iterations; i++) {
        result += Math.sqrt(i) * Math.sin(i);
    }
    return result;
}
const server = http.createServer((req, res) => {
    fibonacci(30);
    loopTest(1000000);
    res.end('OK');
});
server.listen(8082);

Go Test Server

go

package main
import (
    "math"
    "net/http"
)
func fibonacci(n int) int {
    if n <= 1 {
        return n
    }
    return fibonacci(n-1) + fibonacci(n-2)
}
func loopTest(iterations int) float64 {
    var result float64
    for i := 0; i < iterations; i++ {
        result += math.Sqrt(float64(i)) * math.Sin(float64(i))
    }
    return result
}
func handler(w http.ResponseWriter, r *http.Request) {
    fibonacci(30)
    loopTest(1000000)
    w.Write([]byte("OK"))
}
func main() {
    http.HandleFunc("/", handler)
    http.ListenAndServe(":8083", nil)

Python Test Server (Flask)

python

from flask import Flask
import math
import time
app = Flask(__name__)
def fibonacci(n):
    if n <= 1:
        return n
    return fibonacci(n-1) + fibonacci(n-2)
def loop_test(iterations):
    result = 0
    for i in range(iterations):
        result += math.sqrt(i) * math.sin(i)
    return result
@app.route('/')
def cpu_test():
    fibonacci(30)
    loop_test(1000000)
    return 'OK'
if __name__ == '__main__':
    app.run(host='0.0.0.0', port=8084)

Apache Bench Commands

bash

# PHP
ab -n 1000 -c 1 http://phpbenchlab.com:8080/cpu-test
# Node.js
ab -n 1000 -c 1 http://phpbenchlab.com:8082/
# Go
ab -n 1000 -c 1 http://phpbenchlab.com:8083/
# Python
ab -n 1000 -c 1 http://phpbenchlab.com:8084/

Conclusion

This benchmark tells a clear story:

  • Go remains the performance champion – 67 req/s
  • Node.js holds strong second place – 38 req/s
  • PHP 8.5 with JIT delivers 23 req/s – 61% faster than JIT off, closing the gap with Node.js
  • Python trails at 5 req/s – expected for interpreted languages

The most important takeaway for the PHP community: enable JIT. The 61% boost transforms PHP from a performance underdog to a genuinely competitive option for CPU‑intensive tasks. While Go still leads, PHP 8.5 with JIT has firmly established itself as a viable choice – no longer the “slow language” of legend.


All raw data and methodology are provided. Reproduce this benchmark on your own hardware to validate results.

2 thoughts on “PHP 8.5 vs Node.js vs Go vs Python: CPU Performance Benchmark (2026)”

  1. With this kind of comparison, it’s unclear where the improvement comes from: the server or PHP itself. It would make more sense to show fair single-threaded performance.

    Reply
    • “Great question! The article actually already addresses this. In the test, we intentionally set the concurrency level of the ab benchmarking tool to 1, meaning only one request is processed at a time. This was done to eliminate the impact of server‑side concurrent scheduling, ensuring that what we measured is the ‘single‑threaded’ computational performance of the PHP engine itself, rather than the server hardware’s contribution. Therefore, the performance improvement of PHP 8.5 over older versions in the test can indeed be attributed to its own optimizations (especially JIT).”

      Reply

Leave a Comment