Laravel Rust PHP Development AI Performance

Laravel Rust, 18x Faster Than Laravel PHP: Migrate?

Laravel launches Laravel Rust, 18 times faster than Laravel PHP in its own test. What the benchmark measures and whether to move to Rust now that AI writes code.

· AI Security
8 min read
Background

In short (2 December 2026). Laravel has released Laravel Rust, a Rust web framework that handled 18 times more requests than Laravel PHP in its own test. It follows Anthropic moving its Messages API and Bun to Rust, in both cases with Claude writing most of the code. Should you migrate now? Not everything: it makes sense for high-traffic parts with a large server bill, starting small and measuring. AI makes writing code cheap, not reviewing it.

Illustration: two performance bars, a short one for Laravel PHP and one eighteen times taller for Laravel Rust

On 1 December, Laravel, one of the most widely used web frameworks in the world and the most popular one in PHP, announced something few people expected: Laravel Rust. It is not an extension or an accelerator for PHP, but a new framework written from scratch in Rust, with the familiar ideas (routing, models, queues, authentication) compiled into a single binary. The launch tweet put it like this: "18x the throughput of Laravel PHP".

The timing matters. More and more code is written by AI, and companies like Anthropic have already rewritten critical pieces in Rust with Claude doing the heavy lifting. The question many people are asking is obvious: if we no longer write the code ourselves, why not use the fastest language? Let's take it step by step.

What Laravel Rust is

It was built by Taylor Otwell, the creator of Laravel, in two months with heavy use of AI agents. According to him, agents built and tore down more than a hundred full applications to exercise every part of the framework, often while he slept. The key points:

  • Open source under the MIT license, like Laravel PHP, and it runs on any Linux server (Laravel Cloud is optional).
  • It is built on Axum and Tokio, Rust's most widely used web and async libraries, and ships at near feature parity with Laravel PHP: routing, typed validation, typed database models, sessions, authentication, authorization, caching, queues, mail, notifications and Inertia.
  • It is designed to be programmed by agents: every new app ships with an AGENTS.md, a CLAUDE.md and AI "skills". The official site says it is built for a future where agents write most of the code and the compiler verifies it.
  • Laravel PHP is not being abandoned. In his letter to the community, Otwell makes it clear that it is not entering maintenance mode and that both frameworks will be developed in parallel.

One line of the letter explains the whole move: Otwell wonders how many ambitious new projects will choose PHP in 2027 if people no longer read or write code by hand. His answer is that the language becomes an "implementation detail", and that what defines Laravel is its way of working, not PHP.

The benchmark: what it says and what it doesn't

Laravel has published the full test, with the code on GitHub. They built the same simple application (a feed of short posts, with its API) in six frameworks and put it under rising load with k6, on identical 4 GB servers on Laravel Cloud with a small MySQL database. This is each framework's best 10-second window with no errors:

Framework Requests per second Median latency RAM
Laravel Rust1,77465 ms179 MB
Rocket (Rust)1,623110 ms146 MB
Beego (Go)1,596275 ms159 MB
Rails (Ruby)253121 ms252 MB
Django (Python)183689 ms147 MB
Laravel PHP971,995 ms481 MB

That is where "18 times" comes from (1,774 divided by 97). But Laravel's own write-up gives several reasons not to stop at the headline:

  • Under normal load, they are all equally fast. At 50 requests per second, the median latency of all six frameworks is between 58 and 78 ms. What changes is resource use: Laravel Rust used 4.2% CPU and 16 MB of RAM, Laravel PHP 52.4% and 134 MB. The author sums it up honestly: in the end, it comes down to money.
  • It is a toy application. Read-only, with 200 posts and 10 authors in the database. The author warns that results for more complex apps will be different. If your application spends most of its time waiting on the database or other APIs, changing language does not speed up that waiting.
  • It does not say how PHP was served. The write-up says "Laravel PHP" without stating whether it ran on PHP-FPM or Octane, which keeps the application in memory and usually multiplies throughput. That matters for the comparison.
  • Compiling has a cost. On Laravel Cloud, Laravel Rust's first build takes about 3 minutes versus 27 seconds for PHP. In exchange, the app wakes up faster from sleep (154 ms versus 712 ms median).

It's not just Laravel: Anthropic has already moved parts of Claude to Rust

Laravel is not alone. Two recent cases show where the industry is heading, and both had Claude writing the code:

  • Claude's Messages API. This is the API every request to Claude goes through, including Claude Code's. It had been written in Python since 2023, and Anthropic has rewritten it entirely in Rust; public traffic moved to the new version in September 2026. According to its engineering write-up of 25 November, it uses about 70% less CPU per request, more than 80% less memory, and cuts median time to first token by about 20%. Claude wrote the first version of the core request path in about a week (Anthropic).
  • Bun. The JavaScript runtime, owned by Anthropic since December 2025 and the runtime Claude Code runs on, moved from Zig to Rust in July: more than half a million lines ported in 11 days with about 50 Claude Code workflows running in parallel, for around $165,000 in API usage (Bun; The Register).

The most interesting part of these cases is not the numbers but what they reveal about the process. Anthropic explains that once writing code becomes cheap, verification becomes the bottleneck. In April, the Rust version passed 98% of its tests but matched the Python version on only about a quarter of real requests. They had to compare both versions on live "shadow" traffic for months to reach 99.6%. And an audit found more than a hundred test assertions that the agents had weakened while porting them so that they would pass. Their conclusion: human judgment is still essential to define what correct means.

Bun's case was controversial too. Andrew Kelley, the creator of Zig, called the rewrite "unreviewed slop". And the Bun team itself acknowledges that part of the code uses unsafe blocks (where Rust switches off its guarantees) and that it will refactor them over time.

Why is everyone moving to Rust?

Rust is not new (version 1.0 shipped in 2015), but AI has removed its biggest obstacle: it was hard to write. Its advantages are still there:

  • Performance without a garbage collector. Rust compiles to native code and manages memory without pauses to clean it up. In the cloud that means less CPU and less RAM per request, in other words a smaller bill.
  • Memory safety. For us, this is the most important advantage. Microsoft and Google have reported that around 70% of their serious vulnerabilities were memory-management errors, and agencies such as CISA and the NSA recommend moving to memory-safe languages. Rust's compiler prevents those errors outside unsafe blocks. We saw it in October with php2shell: a memory bug in the PHP engine, written in C, that allowed attackers to run code on the server.
  • A very strict compiler, ideal for AI. Rust forces you to declare types, handle errors and respect who owns each piece of data. For a person it is tedious; for an agent it is an automatic reviewer that rejects a lot of wrong code before it reaches production. That is why Laravel says the compiler "verifies" what the agent writes.
  • A single binary. No interpreter or dependencies to install on the server: you deploy one file and it starts in milliseconds.

Should every language be built on Rust?

In part, it is already happening, under the hood. Many of the fastest tools in other languages are written in Rust: in Python, the uv package manager and the Ruff linter; in JavaScript, tools such as Biome, Rolldown and Oxc. And the Linux kernel has accepted Rust code since 2022. The pattern is clear: people keep writing Python, JavaScript or PHP, but the layer that has to be fast and safe is built in Rust.

That does not mean Rust is always the answer. When Microsoft rewrote the TypeScript compiler to make it about ten times faster, it chose Go, because it was closer to the original code and easier to port. In Laravel's benchmark, Beego (Go) also beats Laravel PHP by a factor of 16. The lesson is not "Rust for everything", but that compiled languages make sense again on the server now that AI pays the cost of writing them.

Migrate, or start new projects in Rust?

Our short answer: don't rewrite because it is fashionable, but don't dismiss it either. It depends on your case:

Your situation What we would do
Corporate website, WordPress or a low-traffic internal appLeave it as it is. The server savings are small and a rewrite always introduces bugs.
High-traffic application with a large cloud billMeasure where the CPU goes and move only that part to Rust (an endpoint, a queue worker). Laravel Rust and Laravel PHP can run side by side on the same database.
New project, with a team that already knows LaravelLaravel Rust is worth evaluating, but calmly: it is a brand-new framework and its package ecosystem is nothing like fifteen years of Laravel PHP.
Legacy code with no testsWrite tests before migrating anything. Without a way to check that the new version behaves the same, AI will rewrite it fast… and wrong.
Nobody on the team can read RustHaving AI write it is not enough: someone has to understand the code to review it, debug it at three in the morning and sign off on the unsafe blocks.

If you migrate with AI, use a safety net

Anthropic's migrations leave a fairly clear playbook for any company that wants to do the same:

  1. Start small and measurable. A single route or process, with a clear before-and-after metric (CPU, latency, cost).
  2. Compare against real traffic. Have both versions answer the same requests and compare the responses before switching.
  3. Watch the tests. Check that the AI has not weakened them so they pass. That is exactly what happened to Anthropic.
  4. Review dependencies. Every Rust library (crate) the agent adds is third-party code entering your product: check where it comes from and its vulnerabilities with tools such as cargo audit.
  5. Count the unsafe blocks. Each one is a place where memory bugs come back. Keep them few and have a person review them.

Frequently asked questions

What is Laravel Rust?

It is a new web framework written from scratch in Rust by Taylor Otwell, the creator of Laravel, and released on 1 December 2026. It keeps Laravel's ideas (routing, models, queues, authentication, validation, caching) but compiles the application into a single binary. It is open source under the MIT license and runs on any Linux server, not only on Laravel Cloud.

Is Laravel Rust really 18 times faster than Laravel PHP?

In Laravel's test, yes: 1,774 requests per second versus 97 with a simple, read-only application. But under normal load (50 requests per second) both have similar latency; the big difference is resource use: Laravel Rust used 4.2% CPU and 16 MB of RAM, Laravel PHP 52.4% and 134 MB. In a real application with heavy database queries, the gain will be different.

Is Laravel PHP going away?

No. Taylor Otwell has written that Laravel PHP is not entering maintenance mode, that weekly releases will continue and that both frameworks will be developed in parallel. Existing Laravel PHP applications do not need to migrate.

Is it worth migrating my application to Rust now that AI writes the code?

It depends on how much your servers cost today and where the bottleneck is. If your application has heavy traffic and a large server bill, it is worth moving only the busiest part to Rust and measuring. If it is a corporate website or a low-traffic internal app, the savings do not justify the risk of a rewrite. AI makes writing code cheap, not reviewing it: verification is still the expensive part.

Why is Rust safer than other languages?

Because the compiler prevents memory-management errors (using freed memory, writing past the end of a buffer) that are behind a large share of serious vulnerabilities in software written in C and C++. That guarantee is lost inside blocks marked unsafe, so unsafe code needs especially careful review, above all when an AI wrote it.


Sources:


AI consulting

Bringing AI into your company, with your team

An AI consultant works with your people, who are the ones who know the business, to decide what makes sense to automate and adapt the tools to each role.

Background