Benchmark 2025: PHP vs Competitors — Unexpected Results

Online Python Trainer for Beginners

Learn Python easily without overwhelming theory. Solve practical tasks with automatic checking, get hints in Russian, and write code directly in your browser — no installation required.

Start Course

Benchmark 2025: PHP vs Competitors — Unexpected Results



In early 2025, a team of independent developers conducted large-scale performance testing of popular programming languages in a web environment. The main surprise: PHP, often called "slow" and "outdated," showed results capable of surprising skeptics. Let's dive into the details.



Testing Conditions

Tests were conducted on identical hardware (Intel Xeon, 16 GB RAM, SSD NVMe) using real-world scenarios: CRUD operations, JSON serialization, database work (PostgreSQL), HTML template rendering. Participants included:

  • PHP 8.4 (with JIT compiler, Laravel 12 framework)
  • Python 3.13 (FastAPI + async)
  • Go 1.23 (net/http + Gin)
  • Node.js 22 (Express.js)
  • Java 21 (Spring Boot)


Request Execution Speed

In the "raw" HTTP server test (Hello World), Go led with 185,000 req/s. PHP 8.4 surprised: 142,000 req/s — 30% faster than Node.js (109,000) and nearly twice as fast as Python (78,000). Java showed 155,000 req/s, but considering cold start time (3-5 seconds vs 0.1 for PHP), the situation changed.



Database Operations

In the "1000 SELECT queries with JOIN" scenario, PHP 8.4 processed them in 0.87 seconds — the best result among interpreted languages. Python (2.1 s) and Node.js (1.4 s) lagged behind. Go (0.52 s) and Java (0.45 s) were faster, but the gap narrowed to 30-40% compared to PHP 7.x.



Memory Consumption

  • Go: 28 MB per 1000 requests
  • PHP 8.4: 42 MB (with Laravel — 68 MB)
  • Node.js: 55 MB
  • Java: 120 MB (with Spring Boot)
  • Python: 85 MB

PHP showed excellent efficiency for a scripting language, especially considering that Laravel is a heavy framework.



Latency (Response Delay)

With 10,000 concurrent connections, PHP 8.4 maintained p95 latency at 120 ms. This is slightly worse than Go (40 ms) and Java (65 ms), but better than Node.js (150 ms) and Python (210 ms). The PHP 8.4 JIT compiler significantly improved stability under load.



Conclusions

The 2025 benchmark shatters the myth of PHP's slowness. The modern version 8.4 with JIT and improved memory management makes it competitive even in high-load projects. Of course, Go and Java remain the kings of "raw" performance, but for web development, PHP offers an excellent balance of speed, simplicity, and ecosystem. If your project doesn't require tens of thousands of requests per second on a single server — PHP in 2025 is a reasonable choice.



Source: open data from the BenchLab.io benchmark community, January 2025.

Recommended Libraries