<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: rebin</title>
    <description>The latest articles on DEV Community by rebin (@rebinma).</description>
    <link>https://dev.to/rebinma</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4277134%2F223ad739-3300-49b9-a521-9a66d81062fa.jpg</url>
      <title>DEV Community: rebin</title>
      <link>https://dev.to/rebinma</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rebinma"/>
    <language>en</language>
    <item>
      <title>The End of an Era? I Benchmarked Laravel Rust Against PHP</title>
      <dc:creator>rebin</dc:creator>
      <pubDate>Wed, 02 Dec 2026 13:02:20 +0000</pubDate>
      <link>https://dev.to/rebinma/the-end-of-an-era-i-benchmarked-laravel-rust-against-php-217c</link>
      <guid>https://dev.to/rebinma/the-end-of-an-era-i-benchmarked-laravel-rust-against-php-217c</guid>
      <description>&lt;h2&gt;
  
  
  Taylor said the quiet part out loud
&lt;/h2&gt;

&lt;p&gt;This week, the framework I've built my career on showed up in a completely different language.&lt;/p&gt;

&lt;p&gt;On December 1, Laravel released &lt;a href="https://laravel.com/blog/introducing-laravel-for-rust" rel="noopener noreferrer"&gt;Laravel Rust&lt;/a&gt;. Not a side project. Not a blind port. Laravel itself, reimagined in Rust: routing, models, queues and auth, compiled into a single binary.&lt;/p&gt;

&lt;p&gt;And buried in the launch post was one line I can't stop thinking about. Laravel Rust is built for a world where "humans will increasingly neither write nor manually read application code at scale."&lt;/p&gt;

&lt;p&gt;Read that again.&lt;/p&gt;

&lt;p&gt;For years, PHP's superpower was that anyone could learn it. I'm proof. It's how I started, and since 2020 I've taught Laravel at Tishk International University. As far as I know, I was the first lecturer in the country to bring it into a university course. Now the creator of the most beginner-friendly framework I know is telling us that being easy for humans may no longer be the point. If agents write the code, strict compilers matter more than friendly syntax.&lt;/p&gt;

&lt;p&gt;That's when it hit me. This isn't just another release. It feels like the end of an era.&lt;/p&gt;

&lt;p&gt;So I built the same app four ways and put them under load. Here's the short version:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3ziysvaxj4r7m3vv6bet.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3ziysvaxj4r7m3vv6bet.png" alt="Bar chart of requests per second at 50 connections. Hello: PHP-FPM 12,898, Octane 24,480, Laravel Rust 148,682. GET 20 products: PHP-FPM 4,423, Octane 5,837, Laravel Rust 29,936. POST insert: PHP-FPM 5,412, Octane 7,918, Laravel Rust 15,142, or 21,610 with a pool of 100." width="800" height="535"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I tested it myself
&lt;/h2&gt;

&lt;p&gt;Laravel says Laravel Rust delivers 18x the throughput of Laravel PHP, and to their credit, they &lt;a href="https://laravel.com/blog/laravel-rust-benchmark" rel="noopener noreferrer"&gt;published their benchmark&lt;/a&gt; along with the code. It compares six frameworks on Laravel Cloud, using a read-only API. This article is not an attempt to disprove it.&lt;/p&gt;

&lt;p&gt;I wanted to answer two questions their test leaves open. First, how does Rust compare with &lt;strong&gt;Octane&lt;/strong&gt;, which many of us already use to speed up PHP? Second, what happens when requests &lt;strong&gt;write&lt;/strong&gt; to the database? And I wanted to see it on my own machine, with MySQL, the database I use every day.&lt;/p&gt;

&lt;p&gt;I built the same small API twice, once in Laravel PHP (PHP 8.6) and once in Laravel Rust (0.1.3), with three endpoints:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Hello&lt;/strong&gt;: returns a tiny JSON message. This measures pure framework overhead.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GET products&lt;/strong&gt;: reads 20 rows from a 10,000-row MySQL table through the models.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;POST product&lt;/strong&gt;: validates a JSON body and inserts one row.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I ran the PHP version two ways: classic &lt;strong&gt;PHP-FPM + nginx&lt;/strong&gt;, and &lt;strong&gt;Laravel Octane with FrankenPHP&lt;/strong&gt;, which keeps the app in memory between requests. Both sides used production settings: cached config and routes, OPcache on and debug off for PHP, and a &lt;code&gt;cargo build --release\&lt;/code&gt; binary for Rust.&lt;/p&gt;

&lt;p&gt;Everything ran natively on my Mac (Apple M5 Pro, 15 cores, 48 GB RAM) with MySQL 8.4, no Docker. I used &lt;a href="https://github.com/hatoo/oha" rel="noopener noreferrer"&gt;oha&lt;/a&gt; as the load tool, at 10, 50 and 100 concurrent connections: a 10-second warm-up, then three 30-second runs per test. I report the median of the three. Every request in every run returned the expected status code.&lt;/p&gt;

&lt;p&gt;Two honest caveats: the load tool ran on the same machine as the servers, and a Mac is not a production server. Treat these numbers as a fair side-by-side comparison, not as absolute figures.&lt;/p&gt;

&lt;h2&gt;
  
  
  The results
&lt;/h2&gt;

&lt;p&gt;I tested Laravel Rust twice: with its default database pool of 10 connections, and with the pool raised to 100. You saw the raw speed at the top.&lt;/p&gt;

&lt;p&gt;The headline gap is huge: on the simplest endpoint, Rust handled about 6x more requests than Octane and about 11.5x more than PHP-FPM. But look at what happens as the work gets more realistic:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffxrp066zcx4osjs0gn1r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffxrp066zcx4osjs0gn1r.png" alt="Bar chart of how many times faster Laravel Rust is than Octane at 50 connections: 6.1x on Hello, 5.1x on GET 20 products, and only 1.9x on a POST insert, or 2.7x with a pool of 100. Rust's lead shrinks once the database writes." width="800" height="387"&gt;&lt;/a&gt;&lt;br&gt;
The pattern held at 10 and 100 connections too.&lt;/p&gt;

&lt;p&gt;Speed isn't the whole story, so here's what each setup takes to ship and start:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setup&lt;/th&gt;
&lt;th&gt;Deploy size&lt;/th&gt;
&lt;th&gt;App code (lines)&lt;/th&gt;
&lt;th&gt;Clean build&lt;/th&gt;
&lt;th&gt;Startup to first response&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;PHP-FPM + nginx&lt;/td&gt;
&lt;td&gt;268 MB&lt;/td&gt;
&lt;td&gt;571&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;td&gt;161 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Octane (FrankenPHP)&lt;/td&gt;
&lt;td&gt;268 MB&lt;/td&gt;
&lt;td&gt;571&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;td&gt;412 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Laravel Rust (pool 10)&lt;/td&gt;
&lt;td&gt;57 MB&lt;/td&gt;
&lt;td&gt;430&lt;/td&gt;
&lt;td&gt;52 s&lt;/td&gt;
&lt;td&gt;629 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Laravel Rust (pool 100)&lt;/td&gt;
&lt;td&gt;57 MB&lt;/td&gt;
&lt;td&gt;430&lt;/td&gt;
&lt;td&gt;52 s&lt;/td&gt;
&lt;td&gt;890 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  What the numbers actually mean
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The database is the great equalizer.&lt;/strong&gt; On the hello and read endpoints, Rust is in a different league. But once a request writes to MySQL, Rust's lead over Octane drops to about 2x out of the box, or 2.7x with a bigger connection pool. The database becomes the slow part, and the language stops mattering as much. Most real apps spend a lot of their time in the database, so for a typical CRUD app the real-world gap is smaller than the headline numbers suggest.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Octane is the cheapest win for PHP developers.&lt;/strong&gt; Octane was up to about 1.9x faster than PHP-FPM, with the same code. If you're on PHP-FPM today and not planning to switch, that's your first step.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One setting made a big difference.&lt;/strong&gt; Laravel Rust's database pool defaults to 10 connections. Raising it to 100 made writes about 40% faster, and cut the slowest 1% of POST requests at 100 connections from 54 ms to 21 ms. If you try Laravel Rust, check that setting first.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One thing I can't explain yet.&lt;/strong&gt; On the GET endpoint, Rust's typical request was about 7x faster than Octane's. But under heavy load, its slowest 1% of requests were slower than Octane's, and the bigger pool didn't fix it. If you know why, I'd love to hear it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F76i8zauoq6ei3immi0hz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F76i8zauoq6ei3immi0hz.png" alt="Bar chart of peak memory under load: PHP-FPM 804 MB, Octane 264 MB, Laravel Rust 82 MB, and 75 MB with a pool of 100. Rust used about 10x less memory than PHP-FPM." width="800" height="292"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Memory is where Rust's lead felt most real to me.&lt;/strong&gt; Under load, the Rust app needed about a tenth of PHP-FPM's memory, and less than a third of Octane's. That matters more than ever right now: AI data centers have caused a memory shortage, and &lt;a href="https://gamesbeat.com/ramageddon-why-the-memory-chip-crisis-is-worse-than-expected-lasting-to-2029-or-2030-deloitte/" rel="noopener noreferrer"&gt;server memory prices roughly doubled in early 2026&lt;/a&gt;. Data centers' &lt;a href="https://www.brookings.edu/articles/why-data-centers-are-a-top-issue-in-the-2026-midterms/" rel="noopener noreferrer"&gt;energy use even became an issue in the US midterm elections&lt;/a&gt;. Memory your app doesn't need is money you don't spend.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffqgjps3g9q2x5rpl9yte.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffqgjps3g9q2x5rpl9yte.png" alt="Dot chart of GET 20 products response times at 50 connections, typical (p50) vs slowest 1% (p99): PHP-FPM 11 ms vs 20 ms, Octane 8.5 ms vs 12 ms, Laravel Rust 1.3 ms vs 23 ms, and 1.0 ms vs 30 ms with a pool of 100." width="800" height="355"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Two smaller surprises.&lt;/strong&gt; The Rust deploy was a single 57 MB binary, against 268 MB for the PHP app with its vendor folder and server. And the Rust version of the same app took 430 lines of code, compared with 571 in PHP. I expected Rust to be more verbose, not less.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;There are trade-offs.&lt;/strong&gt; Laravel's own benchmark found that a cold Rust build on Laravel Cloud took about 3 minutes, against 27 seconds for PHP. On my machine, a clean release build took 52 seconds. It also found that at a steady, light load of 50 requests per second, latency was similar across all six frameworks. Rust's speed really shows only under heavy traffic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I didn't hit 18x, and that's fine.&lt;/strong&gt; My best case was about 12x over PHP-FPM, on the simplest endpoint. Laravel's test ran on small 4 GB cloud instances, where PHP topped out at 97 requests per second, and it doesn't say whether PHP ran with Octane. Different hardware, setups and workloads give different numbers. I'm sure there's more to squeeze out of both sides, with Postgres or more tuning.&lt;/p&gt;

&lt;h2&gt;
  
  
  So why would I still choose PHP?
&lt;/h2&gt;

&lt;p&gt;This is the question I can't shake. To be clear, Laravel isn't abandoning PHP. In &lt;a href="https://laravel.com/blog/a-letter-to-the-laravel-community" rel="noopener noreferrer"&gt;a letter to the community&lt;/a&gt;, Taylor wrote that "Laravel PHP is not going anywhere," and that both frameworks will be developed in parallel, with weekly releases continuing. I believe him.&lt;/p&gt;

&lt;p&gt;But the same letter asks whether ambitious new projects in 2027 and beyond will choose PHP at all. That's my question too. If I can have the same familiar framework with a much faster runtime and a fraction of the memory, why would I start my next project in PHP? And if popular packages start shipping Rust versions, the PHP version could slowly lose ground, not because anyone abandons it, but because new projects choose differently.&lt;/p&gt;

&lt;p&gt;To be fair, fast and memory-efficient frameworks have existed for years, in Go and in Rust. I never switched. The reason was never PHP itself. It was Laravel's community.&lt;/p&gt;

&lt;p&gt;Laravel was beginner-friendly in a way nothing else was. The documentation. First-party tools for everything you need: local development, cloud hosting, monitoring, debugging, making your app faster and safer. &lt;a href="https://laracasts.com" rel="noopener noreferrer"&gt;Laracasts&lt;/a&gt;, the one place where you can easily learn it all. Laracon, where developers meet and share. And a team that actually delivers on its promises. That made a lot of us attached to Laravel. I never saw anything else that welcoming, so I stayed with the familiar, despite PHP's hiccups.&lt;/p&gt;

&lt;p&gt;Here's the twist. That beginner-friendliness is exactly what Taylor says matters less now. But it's also why Laravel Rust is the first Rust option I'd seriously consider. I wouldn't be moving to the Rust world alone. The conventions, the ecosystem and the community come with me.&lt;/p&gt;

&lt;h2&gt;
  
  
  So is PHP dead?
&lt;/h2&gt;

&lt;p&gt;No. PHP runs &lt;a href="https://w3techs.com/technologies/overview/programming_language" rel="noopener noreferrer"&gt;70.2% of websites whose server-side language is known&lt;/a&gt;. That code isn't going anywhere.&lt;/p&gt;

&lt;p&gt;October's &lt;a href="https://f5.com/labs/articles/php2shell-exploitation-attempts-observed" rel="noopener noreferrer"&gt;PHP2Shell&lt;/a&gt; made that very clear. Two critical bugs in PHP's engine were patched on October 21, and attackers were trying to exploit them within hours. Everyone scrambled to patch, and it showed how many industries and governments depend on PHP every single day.&lt;/p&gt;

&lt;p&gt;But PHP2Shell is also the strongest argument for Rust I've seen. These were use-after-free bugs: memory-safety errors in PHP's C runtime. They triggered before any application code ran, so no amount of careful validation in your Laravel app could stop them. They hit PHP-FPM, mod_php and FrankenPHP alike. That is exactly the class of bug Rust's compiler prevents. It's the same reason &lt;a href="https://lwn.net/Articles/1049831/" rel="noopener noreferrer"&gt;Rust is now a permanent part of the Linux kernel&lt;/a&gt;: about two-thirds of kernel vulnerabilities came from memory-safety issues.&lt;/p&gt;

&lt;p&gt;To be honest about the limits: Rust won't stop SQL injection, broken authorization or a bad business rule. A Laravel Rust app can still have all of those. But a whole category of problems simply disappears.&lt;/p&gt;

&lt;p&gt;The PHP Foundation has done great work improving the language. But the tech world is moving faster than ever, and PHP's old advantages are fading. PHP was the right choice for a beginner like me 12 years ago. When an agent is writing the code, that's a whole different story.&lt;/p&gt;

&lt;h2&gt;
  
  
  My verdict
&lt;/h2&gt;

&lt;p&gt;PHP isn't dead, but for the first time, I'm not sure it's my default.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;If you have a Laravel PHP app today:&lt;/strong&gt; move to Octane if you haven't, and keep shipping. Your database is probably your real bottleneck anyway.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;If you're starting something new where memory, cost or security really matter:&lt;/strong&gt; Laravel Rust deserves a serious look once it's out of beta. I'll be following it closely.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All the code and raw results are public: the PHP app, the benchmark scripts and every run are in &lt;a href="https://github.com/RebinMA/octane-fpm-rust-bench" rel="noopener noreferrer"&gt;octane-fpm-rust-bench&lt;/a&gt;, and the Laravel Rust app is in &lt;a href="https://github.com/RebinMA/laravel-rust-api" rel="noopener noreferrer"&gt;laravel-rust-api&lt;/a&gt;. Run it on your own machine, try it with Postgres, and tell me what you get. I'd especially like to hear from anyone running it on real server hardware.&lt;/p&gt;

&lt;p&gt;And I'm curious: would you switch?&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>rust</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
