Laravel now has an official port to Rust: laravel-rust, first published on crates.io on 29 November 2026. I already had a small Laravel app in two versions, so I could ask the question the announcement leaves open: how does the same app behave on the two stacks?
The app is Laravel Codice Fiscale in its showcase form, a page that calculates, decodes and lists Italian tax codes. The PHP version is a Laravel 13 app with Livewire and Flux, live at laravel-codicefiscale-showcase.onrender.com. The Rust version is a twin built on laravel-rust with the codicefiscale crates, live at laravel-codicefiscale-rs-showcase.onrender.com. I measured both in local containers with the same load, and then looked at what each costs on Render's free tier. The harness and every raw result are in laravel-php-vs-rust-benchmark.
A caveat before the numbers: laravel-rust is at 0.1.x and a few days old. This is a first look at a young framework, taken on one machine and one small app, and it says little about what Laravel for Rust will be once it matures.
What was compared
| PHP | Rust | |
|---|---|---|
| Framework | Laravel 13.25.0 | laravel-rust 0.1.4 |
| Language | PHP 8.4.28 | Rust 1.100 (the showcase requires 1.99 or later) |
| UI | Livewire 3.8.4, Flux 2.16.0 | MiniJinja views, htmx |
| Codice fiscale logic | robertogallea/laravel-codicefiscale 3.2.0 |
codicefiscale 0.1 crates |
| HTTP server | nginx 1.30 and PHP-FPM | the framework's own server (axum 0.8.9) |
| Birthplace data | SQLite file, read on each request | JSON loaded in memory |
Both apps use the same four release assets for the birthplace dataset: 19,894 municipalities and 285 foreign countries. Both seed the same three people on /people. The pinned source revisions are in sources.lock.json of the benchmark repo, and the showcase repos are PHP, Rust and the Rust crates.
How I measured
Each variant is built into a container from a pinned commit and runs on a 22-thread Intel Core Ultra 7 155H with 32 GB of RAM, Ubuntu 24.04 and Docker 29.10.1. The load generator is oha 1.17.0. The containers are pinned to cores and limited by two CPU profiles that mimic small hosts: free is 0.1 CPU and 512 MB, the size of Render's free instance, and cpu1 is one full CPU.
There are four variants.
- Rust: the showcase image as deployed.
- PHP-FPM as deployed: the PHP showcase's own Dockerfile and
render.yamlenvironment, as it runs on Render. - PHP-FPM tuned: the same image with production settings added, to answer the objection that I forgot to switch on opcache. It uses
validate_timestamps=0, JIT, config, route, view and event caches, a classmap-authoritative autoloader, file sessions and cache, a static FPM pool sized per profile, and a tuned nginx. - PHP on Octane with FrankenPHP: the same code served by a long-running worker, which removes the per-request boot.
The first finding came before any load: the deployed PHP image already had opcache enabled, with PHP's defaults. The tuned variant adds timestamp validation off, JIT and the caches on top of that. Every setting is listed in docs/variants.md of the benchmark repo, and the Octane changes are in overlays/php-octane/README.md.
There are four workloads: /, a calculate request, a decode request and /people. /, decode and /people are the same plain GET on both stacks. Calculate has no GET in either app, so I replay each app's real request. On Rust that is the htmx form POST with the session cookie and CSRF token. On PHP it is the Livewire update call with the component snapshot taken from the page. The two requests do the same work and return different envelopes, as described in the next section.
The numbers in this post come from the full protocol. Every run starts a fresh container, replays the calculate request 50 times, warms up for 30 s at the run's concurrency and then measures for 60 s. The matrix is four variants, four workloads, both CPU profiles and 1, 10 and 50 connections, with three runs per cell: 288 runs and 96 cells, reported as medians. The run took two sessions, and the images were the same throughout. The application container is pinned to two performance cores (CPUs 6 and 8) and the CPU quota limits it to 1 CPU or 0.1 CPU. oha is pinned to three other cores. Memory is the anonymous memory of the container's cgroup, sampled every second during each window. The machine was shared with unrelated containers throughout, and the load average is stored with every run. A compressed run with 15 s windows and warm containers came first and reached the same conclusions. Its records are in the repo as well.
Every request sends Host: localhost and Accept-Encoding: identity. The second header matters: FrankenPHP's server answers with zstd by default (the home page shrank from 50.7 KB to 7.5 KB) while nginx and the Rust server send plain bodies, and that would have skewed the Octane comparison.
The 288 runs recorded 9.3 million responses, with zero non-2xx responses and zero connection errors. A cell is flagged when its runs spread by more than 20% of the median in throughput or in p99 latency, and an asterisk in the req/s column marks it. 26 of the 96 cells are flagged: 10 Octane, 8 deployed FPM, 5 Rust and 3 tuned FPM. Many flags come from p99 values that are a fraction of a millisecond to a few tens of milliseconds, where a small absolute swing is a large share of the median. Four of the five Rust flags are of that kind, with a throughput spread of 5% or less. The fifth is /people at one CPU and one connection, where one run reached 1,955 requests a second against a median of 3,427. The differences between variants are large next to this noise, and the tail latencies of the fastest cells carry the most of it.
Render's role is limited to a final check on the live free-tier services, described near the end. Load tests on a free instance would be unkind to Render and would measure its throttling, so the local containers carry the comparison.
Do the two apps do the same work?
Before anything was timed, bench parity ran each workload once against every variant and compared what a visitor reads. Calculating Mario Rossi, born on 12 April 1985 in Milano, gives RSSMRA85D12F205O in both. Decoding that code gives Male, 1985-04-12 and MILANO in both. /people lists the same three rows in the same order. Every load run replays its request 50 times first and fails if any answer is not 2xx or has the wrong code.
The responses differ in size. These are raw HTML bytes.
| workload | Rust | PHP (FPM, as deployed) |
|---|---|---|
/ |
23,993 B | 50,721 B |
| decode | 32,120 B | 58,011 B |
/people |
9,283 B | 18,432 B |
| calculate | 10,810 B | 30,374 B |
The visible text on / is the same, about 1.5 KB in both. The extra bytes are markup. Flux emits long Tailwind class strings for each element: 25.2 KB of class attributes on PHP against 8.5 KB on Rust. Inline SVG adds 4.5 KB (nine icons against one), and Livewire adds its component snapshot, an inline style block, a larger inline script and wire:* and x-* attributes. With gzip the PHP page is 7.1 KB and the Rust page 4.0 KB, so on a real connection the 27 KB gap shrinks to about 3 KB. The load runs ask for uncompressed bodies in every variant, for the reason given in the method.
Calculate returns a fragment on Rust and a JSON envelope on PHP that includes the snapshot Livewire needs for the next call. The same POST without the htmx header would return the whole Rust page (30,081 B). PHP also reads the birthplace data from SQLite on each request while Rust keeps it in memory. These differences belong to the stacks, so I left them in.
The results
Every number below is the median of three 60 s runs on fresh containers. The headline setting is one CPU and ten concurrent connections, the load a small instance sees when a handful of visitors arrive together. Rust answers about 40 times faster than tuned PHP-FPM on the home page at both CPU profiles. The sections that follow give latency, throughput, what tuning buys PHP, memory, image size, start-up and build time.
Latency
At 1 CPU and 10 connections, medians of three 60 s runs:
| Workload | Variant | p50 | p99 | req/s |
|---|---|---|---|---|
/ |
Rust | 2.4 ms | 2.9 ms | 4,531 |
/ |
PHP-FPM as deployed | 99 ms | 444 ms | 80* |
/ |
PHP-FPM tuned | 97 ms | 200 ms | 108 |
/ |
PHP on Octane | 70 ms | 147 ms | 128 |
| calculate | Rust | 3.3 ms | 4.0 ms | 3,281 |
| calculate | PHP-FPM as deployed | 93 ms | 508 ms | 83 |
| calculate | PHP-FPM tuned | 90 ms | 106 ms | 121* |
| calculate | PHP on Octane | 76 ms | 91 ms | 131 |
| decode | Rust | 2.8 ms | 3.4 ms | 3,848 |
| decode | PHP-FPM as deployed | 106 ms | 495 ms | 75 |
| decode | PHP-FPM tuned | 102 ms | 202 ms | 96 |
| decode | PHP on Octane | 85 ms | 145 ms | 109 |
/people |
Rust | 2.2 ms | 12.2 ms | 4,234 |
/people |
PHP-FPM as deployed | 73 ms | 430 ms | 108 |
/people |
PHP-FPM tuned | 84 ms | 202 ms | 134 |
/people |
PHP on Octane | 45 ms | 163 ms | 177 |
The asterisk marks the two cells whose three runs spread by more than 20%.
With a single connection the picture is the same without queueing: on / the p50 is 0.3 ms on Rust, 8.0 ms on tuned FPM and 6.8 ms on Octane. At 50 connections the PHP variants queue, with a p50 between 280 and 688 ms, and Rust stays between 11 and 13 ms.

Figure 1. Latency at 1 CPU and 10 connections, medians of three 60 s runs.
On the free profile (0.1 CPU) the gap is the same size and the units change. At ten connections Rust keeps a p50 of 2.6 to 4.5 ms with 243 to 336 requests a second. Its p99 sits between 96 and 99 ms, which matches the 100 ms CPU quota period: a container with a tenth of a CPU runs for 10 ms and waits for the rest of each 100 ms period. The PHP variants have a p50 between 1.1 and 3.2 s and complete 3 to 10 requests a second.
At 50 connections on 0.1 CPU the PHP variants queue for many seconds, with a p50 between 5 and 18 s and a p99 between 8 and 26 s. Rust has a p50 between 107 and 201 ms.

Figure 3. The free profile (0.1 CPU, 512 MB) at 10 connections.
Throughput
The requests-per-second column above is the throughput. Rust handles 3,300 to 4,500 requests a second on one CPU. Tuned PHP-FPM handles 96 to 134, Octane 109 to 177 and the deployed image 75 to 108. At 0.1 CPU Rust handles 243 to 336 and every PHP variant fewer than 10. Throughput stays within 10% from 10 to 50 connections in every variant, and the extra connections turn into latency.
The flagged cells are described in the method, and they sit mostly in tail latency. The quick run had one window in which the deployed image answered nothing for 15 s. It did not repeat on fresh containers: all 288 full runs completed.

Figure 2. Throughput at 1 CPU and 10 connections. The axis is logarithmic.
What tuning buys PHP
The deployed image already ran with opcache on, at PHP's defaults. Tuning adds timestamp validation off, JIT, the Laravel caches, a classmap-authoritative autoloader and a static pool, and it takes throughput at 1 CPU from 80 to 108 requests a second on /. Across the four workloads the gain is 1.2 to 1.5 times at 10 connections and 1.6 to 2.0 times at one connection. At 0.1 CPU it is 1.3 to 1.8 times.
Octane removes the per-request boot. At 1 CPU it adds 7% to 32% on top of tuned FPM across all workloads and concurrencies, with a lower p50. At 0.1 CPU it delivers 0.39 to 0.97 times the throughput of tuned FPM, with a single worker and a larger process. I did not investigate why.
Tuning and Octane both change the numbers less than I expected, and CPU time per request shows why. In tuned FPM a request for / costs about 11 ms of CPU, against 3.7 ms for the /up health check. In Octane's worker mode / still costs about 7 ms with JIT on, and /up costs 0.8 ms. Octane saves the roughly 3 ms of framework boot on every request. The other 7 ms are the page itself: a full-page Livewire render with Flux and Blade components, and the SQLite read. Opcache, JIT, caches and a resident worker all leave that work in place.
This is the finding I find most useful for Laravel developers. Per-request cost in this app is dominated by rendering, and the usual deployment knobs reach the boot and the compile steps. The gap to Rust is a gap between whole stacks, with the language as one part of it, and the two pages differ in weight as well, since Flux components emit about twice the markup of the Rust app's hand-written templates.
Memory
Under load, anonymous memory stays flat. Rust uses 16 to 23 MiB at every concurrency. The deployed FPM image uses 14 to 25 MiB, and the tuned image 19 to 21 MiB at 1 CPU and 11 to 12 MiB at 0.1 CPU, where it runs a single worker. Octane uses 61 to 82 MiB: the resident worker plus the FrankenPHP runtime.
At idle, with the app ready and no traffic:
| Variant | Idle memory (docker stats) |
Idle anonymous memory |
|---|---|---|
| Rust | 17.0 MiB | 16.5 MiB |
| PHP-FPM as deployed | 42.7 MiB | 17.8 MiB |
| PHP-FPM tuned | 52.2 MiB | 14.6 MiB |
| PHP on Octane | 108.8 MiB | 69.7 MiB |
These are medians of three cold starts on the free profile, measured on the first set of PHP images, which carried PHP 8.4.24. All PHP variants now run 8.4.28. docker stats still counts active page cache from reading the PHP codebase, so the anonymous column is the closest figure to resident memory. At idle the PHP-FPM images and Rust are close on anonymous memory.

Figure 4. Anonymous memory at 1 CPU: idle after start, then mean and peak under 10-connection load, for the highest of the four workloads.
Image size
| Variant | Stored size | gzip of docker save |
|---|---|---|
| Rust | 130.2 MB | 46.1 MB |
| PHP-FPM as deployed | 167.1 MB | 55.1 MB |
| PHP-FPM tuned | 174.1 MB | 56.5 MB |
| PHP on Octane | 255.5 MB | 84.1 MB |
The Rust image is the smallest, and it is a Debian slim image with one binary and the dataset. The tuned variant is the deployed image plus 7 MB of overlay.
Cold start, locally
The clock starts at docker run and stops at the first 200 on /up, with the image already local. Medians of three runs, containers pinned to two performance cores. These ran on the PHP 8.4.24 images, and a patch release is unlikely to move them.
| Variant | free, /up |
free, / |
cpu1, /up |
cpu1, / |
|---|---|---|---|---|
| Rust | 1.59 s | 1.69 s | 0.26 s | 0.27 s |
| PHP-FPM as deployed | 2.85 s | 3.76 s | 0.36 s | 0.44 s |
| PHP-FPM tuned | 4.63 s | 6.03 s | 0.52 s | 0.65 s |
| PHP on Octane | 16.24 s | 18.04 s | 1.40 s | 1.53 s |
The start includes what each entrypoint does. Rust migrates and seeds SQLite at every start. The tuned variant runs config:cache, and the Octane image runs four Laravel cache commands before it boots, which takes 16 s at 0.1 CPU. These figures isolate the app, which makes them the right ones for comparing the stacks. The numbers on Render follow below.
Build time
| Variant | Clean build |
|---|---|
| Rust | 2 min 2 s |
| PHP-FPM as deployed | 59 s |
| PHP-FPM tuned | 3 s on top of deployed |
| PHP on Octane | 25 s |
These builds ignore the cache and re-run every step, with the base images already local. The FPM image and its build were measured on PHP 8.4.24, and the Octane image carries 8.4.28. The Rust build splits roughly into 39 s of dependencies and 75 s for the app crate and the link. This is where Rust charges its price: a release build takes about twice as long as the PHP image.

Figure 5. Image size, clean build time and local cold start.
On Render
Both showcases run on Render's free tier, and I probed them from my own machine with curl, one request at a time. The probe has no access to the dashboard, and it located itself only through the Cloudflare colo code in the cf-ray header: responses came from Rome (FCO) and Milan (MXP). Every request is a fresh curl process, so each one includes DNS, TCP and TLS setup.
For the cold start I waited until a service had seen 17 minutes without traffic from the probe (Render spins free services down after about 15), then timed /up and right after it /. All six samples were cold, three per service.
| Service | Round | /up first byte |
then / total |
|---|---|---|---|
| Rust | 1 | 12.58 s | 0.35 s |
| PHP | 1 | 13.44 s | 1.03 s |
| Rust | 2 | 12.61 s | 0.33 s |
| PHP | 2 | 21.44 s | 1.13 s |
| Rust | 3 | 12.18 s | 0.30 s |
| PHP | 3 | 11.53 s | 1.01 s |
Rust woke up in 12.2 to 12.6 s on every round, and PHP in 11.5 to 21.4 s with a median of 13.4 s. Once /up had woken a service, the first / took about 0.3 s on Rust and about 1.0 s on PHP. Three samples are too few for a distribution, and the single 21 s PHP wake-up shows how much one sample can vary.
After the cold rounds I sent 30 rounds of the four workloads, one request at a time, Rust and PHP back to back. All 240 responses were 200, and the calculate request was checked to return RSSMRA85D12F205O before the run.
| Workload | Rust median | PHP median | Rust p90 | PHP p90 |
|---|---|---|---|---|
/ |
0.281 s | 0.397 s | 0.316 s | 0.499 s |
| calculate | 0.277 s | 0.399 s | 0.323 s | 0.488 s |
| decode | 0.288 s | 0.420 s | 0.325 s | 0.576 s |
/people |
0.281 s | 0.370 s | 0.313 s | 0.490 s |
Total time per request, 30 requests per row. Rust answers in about 0.28 s and PHP in 0.37 to 0.42 s. The roughly 0.1 s between them sits next to a fixed cost of 0.1 to 0.4 s for DNS, connect and TLS, and the first-byte medians show the same picture (0.28 s on Rust, about 0.4 s on PHP). Network time dominates these numbers, and a free instance shares its CPU with other tenants, so they describe these two deployments from this connection and sit apart from the local container figures.
One more limit: the Rust service was redeployed with 0.1.4 at 11:03 on the day of the probe, and nothing in /up or the response headers reveals the build version. A 200 on a warm service fits a finished deploy and cannot show which build answers.
Two caveats apply to the cold-start numbers. Most of a cold start on Render is platform time: scheduling the instance, pulling the image and booting it, all before the app answers. The local cold start isolates the app, and there Rust needs 0.26 s against 0.36 s for FPM at one CPU. The two services also reach Render differently. Render builds the PHP service from its Dockerfile, and the Rust service pulls a prebuilt image from GHCR. That difference alone can move a cold start, so the comparison on Render carries more noise than the local one, where only the app is timed.
What it costs
Rust charges its price at build time and in maturity. A clean release build takes 2 min 2 s, about twice the PHP image and five times the Octane image. The framework is at 0.1.x, so the API can still change under the app, and the ecosystem around it is small next to Laravel's. The app code is Rust, with its compile step in the feedback loop.
PHP charges at run time. On this app a PHP request needs 7 to 11 ms of CPU where Rust needs a fraction of a millisecond, so one CPU serves about 100 PHP requests a second against about 4,000. On a 0.1 CPU instance PHP delivers under 10 requests a second and the visitor waits one to three seconds under ten concurrent connections and five to eighteen seconds under fifty, while the Rust app stays at a few milliseconds at ten and answers in 107 to 201 ms at fifty. PHP responses are about twice the size of the Rust ones, with the same visible content. The memory cost is modest: an FPM container idles near 18 MiB of anonymous memory against 17 for Rust, and Octane adds a resident worker at 61 to 82 MiB. The Rust image is 130 MB against 167 MB for the deployed PHP one.
Whether those costs matter depends on the traffic. A showcase for a tax-code library on a free instance rarely sees ten concurrent users. The numbers matter when an app has to serve many requests on little hardware, and Render's free tier is the hardware where both showcases live.
How it was done
I chose the method, the variants and the workloads, and I checked the results. Claude Code built the harness, wrote the parity check and ran the measurements through subagents, one task per ticket. The raw JSON for every run is in the repo, and every figure is regenerated from it by one command.
Takeaways
- On this app Rust handles about 40 times the requests of tuned PHP-FPM on the home page at both CPU profiles I measured (23 to 43 times across the four workloads), with p50 latencies of 2 to 3 ms against 45 to 106 ms at ten connections and one CPU.
- The deployed PHP image already had opcache on. Full FPM tuning gains 1.2 to 1.5 times at ten connections, and Octane adds another 7% to 32% at one CPU while losing at 0.1 CPU.
- What remains of PHP's cost is per-request application work: about 7 ms of the 11 ms for
/is rendering the page. The Rust gap reflects the whole stack. - The responses differ in size by about a factor of two because of markup, with the same visible content. After compression the gap is about 3 KB.
- Rust gives a smaller image and a lighter start and asks for a build that takes twice as long, from a framework that is a few days old.
- These numbers come from one machine and one small app, with 26 of 96 cells flagged for spread, mostly in tail latency. The ratios between variants are large next to that noise, and the absolute values apply to this hardware.
The harness, the raw results and the figures are in laravel-php-vs-rust-benchmark. The framework is laravel-rust, and the project page for the app is Laravel Codice Fiscale.
Get the next posts by email
An occasional newsletter with my new Posts, with one-click unsubscribe. How I handle your address.