Updated on 3 December 2026 with Laravel Go. The first version compared Rust and PHP. The Go app is now a row in every table and a voice in every comparison, and the figures, the static measurements and the Render check were taken again for all three stacks.
Laravel now has official ports to Rust and Go. laravel-rust was first published on crates.io on 29 November 2026, and Laravel Go (go.laravel.com) was first released on 2 December. I already had a small Laravel app in PHP and in Rust, and I built a Go twin of it, so I could ask the question the announcements leave open: how does the same app behave on the three 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. The Go version is a second twin built on Laravel Go with my laravel-codicefiscale-go library, live at laravel-codicefiscale-go-showcase.onrender.com. I measured all three 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-rust-go-benchmark.
A caveat before the numbers: laravel-rust and laravel/go are both at 0.1.x, and laravel/go was first released on 2 December 2026. This is a first look at two young frameworks, taken on one machine and one small app, and it says little about what Laravel for Rust and Laravel for Go will be once they mature.
What was compared
| PHP | Rust | Go | |
|---|---|---|---|
| Framework | Laravel 13.25.0 | laravel-rust 0.1.4 |
Laravel Go (go.laravel.com) v0.1.1 |
| Language | PHP 8.4.28 | Rust 1.100 (the showcase requires 1.99 or later) | Go 1.27.1 |
| UI | Livewire 3.8.4, Flux 2.16.0 | MiniJinja views, htmx | html/template views, htmx |
| Codice fiscale logic | robertogallea/laravel-codicefiscale 3.2.0 |
codicefiscale 0.1 crates |
laravel-codicefiscale-go v0.1.0 (adapter) and codicefiscale v0.1.0 (core) |
| HTTP server | nginx 1.30 and PHP-FPM | the framework's own server (axum 0.8.9) | net/http |
| Birthplace data | SQLite file, read on each request | JSON loaded in memory | JSON loaded in memory |
All three apps use the same four release assets for the birthplace dataset: 19,894 municipalities and 285 foreign countries. All three 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 Go. The libraries are the Rust crates and the Go module.
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 five variants.
- Rust: the showcase image as deployed.
- Go: the Go showcase image as deployed, with the runtime's default settings.
- 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 all three stacks. Calculate has no GET in any app, so I replay each app's real request. On Rust and Go that is the htmx form POST with the session cookie and CSRF token, and the Go run reuses the request prepared for Rust. On PHP it is the Livewire update call with the component snapshot taken from the page. The 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 first matrix covered Rust and the three PHP variants: four workloads, both CPU profiles and 1, 10 and 50 connections, with three runs per cell, which makes 288 runs and 96 cells, reported as medians. It took two sessions, and the images were the same throughout. The Go runs came in a third session on 3 December: Go and Rust again, with the same matrix, which makes 144 runs and 48 cells. The second Rust run is an anchor. Its rule was that the median throughput of every Rust cell had to land within 10% of the original median, or within 20% for the cells flagged for spread in the original run. All 24 cells passed, and the largest deviation was +5.4%. The two sessions are therefore comparable, and the tables below use the original Rust and PHP runs together with the Go runs. 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 and Go servers 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, and the 144 runs of the Go session recorded another 14.2 million with the same zeros. 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 original 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.4% 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 Go session flagged 3 of its 24 Go cells and 4 of its 24 Rust anchor cells, and I keep those counts apart from the original 26. 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 three 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 all three. Decoding that code gives Male, 1985-04-12 and MILANO in all three. /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 | Go | PHP (FPM, as deployed) |
|---|---|---|---|
/ |
23,993 B | 23,987 B | 50,721 B |
| decode | 32,120 B | 32,114 B | 58,011 B |
/people |
9,283 B | 9,279 B | 18,432 B |
| calculate | 10,810 B | 10,810 B | 30,374 B |
The Go markup is ported one to one from the Rust app, with the same classes and the same htmx. The only byte differences are the app name in the page title, the header link and the home page heading, where Rust becomes Go. The visible text on / is the same, about 1.5 KB in all three. The extra bytes on PHP 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 Go 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 and Go keep 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. On the home page Rust handles about 40 times the requests of tuned PHP-FPM at both CPU profiles, and Go about 28 times at one CPU and 22 times at 0.1 CPU. 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 |
/ |
Go | 1.1 ms | 56.7 ms | 3,048 |
/ |
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 | Go | 1.5 ms | 58.5 ms | 2,246 |
| 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 | Go | 1.5 ms | 59.4 ms | 2,215 |
| 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 |
Go | 1.3 ms | 55.1 ms | 2,853 |
/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 and on Go, 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. Rust stays between 11 and 13 ms, and Go between 3.7 and 8.7 ms with a p99 between 74 and 225 ms.

Figure 1. Latency at 1 CPU and 10 connections, medians of three 60 s runs.
Go has the lowest median of the five variants at ten connections, 1.1 to 1.5 ms against 2.2 to 3.3 ms for Rust, and a p99 of 55 to 59 ms against 3 to 4 ms for Rust on three of the workloads. The cause is CPU throttling. Go 1.27 sets GOMAXPROCS from the container's CPU limit rounded up, with a floor of 2. I checked the value inside the container and in the runtime source. The container has a quota of one CPU on two pinned cores, so the runtime runs on both of them and uses up the quota early in each 100 ms period. The cgroup then freezes the container until the next period, and a request that arrives during the freeze waits for it. Default Go was throttled in every period I counted, for 80 to 92 ms each. Requests served in the live part of the period are fast, which gives the low median.
To confirm it I ran a diagnostic variant, the same Go image started with GOMAXPROCS=1: 24 runs at ten connections on both profiles. At one CPU the p99 falls to 6 to 9 ms and the throughput rises by 8% to 11%. The p50 rises to 2.3 to 3.4 ms, close to Rust's, and the throttled periods drop from every period to 81 to 115 of about 600. The gap to Rust in throughput stays: with GOMAXPROCS=1 Go reaches 0.63 to 0.75 of Rust's requests a second. This is the same story as PHP as deployed against PHP tuned. The default setting leaves performance on the table, and a setting matched to the container recovers part of it. The tables keep the default Go row, which is what anyone running the image gets.
On the free profile (0.1 CPU) the Rust and PHP 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. Go completes 128 to 181 requests a second with a p50 of 2.1 ms on /, 19 ms on /people and 94 ms on calculate and decode, and a p99 between 301 and 499 ms. 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 and a p99 between 0.2 and 0.4 s. Go has the same p50 range, 103 to 202 ms, and a p99 between 2.1 and 3.0 s. On this profile GOMAXPROCS=1 raises Go's throughput by 39% to 48% at ten connections and worsens its p99 on three of the four workloads, from 402 to 499 ms up to 697 to 896 ms on /, calculate and decode. I did not investigate why.

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 and Go 2,200 to 3,000. Tuned PHP-FPM handles 96 to 134, Octane 109 to 177 and the deployed image 75 to 108. At ten connections Go reaches 0.58 to 0.68 of Rust's throughput, and across all three concurrencies at one CPU 0.57 to 0.80. At 0.1 CPU Rust handles 243 to 336, Go 128 to 181 and every PHP variant fewer than 10. At one CPU throughput stays within 10% from 10 to 50 connections in every variant, and the extra connections turn into latency.
Laravel's launch post for Laravel Go says Go has "very similar real-world speed" to Rust. On this app, locally at one CPU, Go serves 0.57 to 0.80 of Rust's requests. On Render, warm, the two answer in about the same time, as the Render section shows, because the network dominates the request there.
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, and so did the 144 of the Go session.

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 and Go is a gap between whole stacks, with the language as one part of it, and the pages differ in weight as well, since Flux components emit about twice the markup of the hand-written templates in the Rust and Go apps.
Memory
Under load, anonymous memory stays flat on Rust, which uses 16 to 23 MiB at every concurrency. Go uses 18 to 31 MiB and grows with concurrency: about 18 MiB with one connection and 30 MiB with fifty on /. 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 78 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 |
| Go | 23.6 MiB | 22.9 MiB |
| PHP-FPM as deployed | 42.9 MiB | 17.8 MiB |
| PHP-FPM tuned | 52.2 MiB | 14.7 MiB |
| PHP on Octane | 108.7 MiB | 69.5 MiB |
These are medians of three cold starts on the free profile, from one session on 3 December that measured all five variants on the current images, with PHP 8.4.28 in all three PHP variants. 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, and Go sits about 6 MiB above Rust.

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 |
| Go | 116.9 MB | 42.7 MB |
| PHP-FPM as deployed | 170.7 MB | 56.3 MB |
| PHP-FPM tuned | 177.7 MB | 57.6 MB |
| PHP on Octane | 255.5 MB | 84.1 MB |
The Go image is the smallest, 10% below Rust. Both are a Debian slim image with the application 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, all five variants in the same session.
| Variant | free, /up |
free, / |
cpu1, /up |
cpu1, / |
|---|---|---|---|---|
| Rust | 1.57 s | 1.66 s | 0.28 s | 0.29 s |
| Go | 2.27 s | 2.76 s | 0.29 s | 0.31 s |
| PHP-FPM as deployed | 2.86 s | 3.77 s | 0.38 s | 0.46 s |
| PHP-FPM tuned | 4.48 s | 6.08 s | 0.53 s | 0.67 s |
| PHP on Octane | 16.20 s | 17.99 s | 1.38 s | 1.51 s |
Go starts as fast as Rust at one CPU, and takes 2.27 s against 1.57 s on /up at 0.1 CPU. The start includes what each entrypoint does. Rust and Go migrate and seed 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 | 3 min 2 s |
| Go | 1 min 38 s |
| PHP-FPM as deployed | 1 min 14 s |
| PHP-FPM tuned | 3 s on top of deployed |
| PHP on Octane | 38 s |
These builds ignore the cache and re-run every step, with the base images already local. The Rust build splits into about 85 s of dependencies and 71 s for the app crate and the link. The Go build splits into 58 s of downloads (the modules and the CSS tool) and 15 s for go build, which also compiles the framework packages because the build cache is empty. This is where Rust charges its price: a release build takes about 2.4 times as long as the deployed PHP image and about 4.7 times the Octane image, and the Go build takes 1.3 and 2.6 times.
Clean builds varied between the two measurement days. On 2 December Rust took 122 s, with 39 s of dependencies, the deployed PHP image 59 s and Octane 25 s. On 3 December they took 182 s, with 85 s of dependencies, 74 s and 38 s. Most of the Rust difference is the dependency step, and I did not isolate the cause. The order of the variants held on both days.

Figure 5. Image size, clean build time and local cold start.
On Render
All three showcases run on Render's free tier, and I probed them on 3 December from my own machine with curl, one request at a time, in one session. The probe has no access to the dashboard, and it located itself only through the Cloudflare colo code in the cf-ray header: every response came from Rome (FCO). 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 nine samples were cold, three per service.
| Service | Round | /up first byte |
then / total |
|---|---|---|---|
| Rust | 1 | 11.47 s | 0.37 s |
| Go | 1 | 12.50 s | 0.60 s |
| PHP | 1 | 21.62 s | 1.22 s |
| Rust | 2 | 11.58 s | 0.42 s |
| Go | 2 | 12.47 s | 0.60 s |
| PHP | 2 | 14.55 s | 1.22 s |
| Rust | 3 | 11.56 s | 0.44 s |
| Go | 3 | 11.50 s | 0.72 s |
| PHP | 3 | 13.53 s | 1.23 s |
Rust woke up in 11.5 to 11.6 s, Go in 11.5 to 12.5 s and PHP in 13.5 to 21.6 s, with medians of 11.6, 12.5 and 14.5 s. Once /up had woken a service, the first / took 0.37 to 0.44 s on Rust, 0.60 to 0.72 s on Go and about 1.2 s on PHP. Three samples are too few for a distribution, and the single 21.6 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, with the three services back to back. All 360 responses were 200, and the calculate request was checked to return RSSMRA85D12F205O on each service before the run.
| Workload | Rust median | Go median | PHP median | Rust p90 | Go p90 | PHP p90 |
|---|---|---|---|---|---|---|
/ |
0.345 s | 0.352 s | 0.457 s | 0.414 s | 0.392 s | 0.529 s |
| calculate | 0.356 s | 0.355 s | 0.436 s | 0.397 s | 0.377 s | 0.484 s |
| decode | 0.355 s | 0.354 s | 0.463 s | 0.396 s | 0.391 s | 0.730 s |
/people |
0.353 s | 0.347 s | 0.434 s | 0.381 s | 0.376 s | 0.482 s |
Total time per request, 30 requests per row. Rust and Go answer in about 0.35 s and PHP in 0.43 to 0.46 s. Rust and Go cannot be told apart here, which is the "very similar real-world speed" of Laravel's launch post. The roughly 0.1 s between them and PHP 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.34 to 0.35 s on Rust and Go, 0.43 to 0.45 s on PHP). Network time dominates these numbers, and a free instance shares its CPU with other tenants, so they describe these three deployments from this connection and sit apart from the local container figures.
One more limit: nothing in /up or the response headers reveals the build version of a service. I checked the repositories' deploy records against the pinned commits. They match: Go's deploy pushed the pinned commit, Rust's last deploy has a tree identical to the pinned one, and PHP's deployment record is for the pinned commit. A deployment record shows what Render was told to deploy and that it finished, and cannot show which build answers a request.
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.28 s and Go 0.29 s against 0.38 s for FPM at one CPU. The services also reach Render differently. Render builds the PHP service from its Dockerfile, and the Rust and Go services pull 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 3 min 2 s, about 2.4 times the PHP image and 4.7 times the Octane image. Go builds in 1 min 38 s. Both frameworks are at 0.1.x, released days apart, so the API can still change under the app, and the ecosystem around them is small next to Laravel's. The app code is Rust or Go, with a compile step in the feedback loop.
Go charges at run time, and mostly in the tail. At one CPU it serves 2,200 to 3,000 requests a second, 0.58 to 0.68 of Rust's at ten connections, with a p99 of 55 to 59 ms under the default runtime settings. Matching GOMAXPROCS to the quota brings the p99 to 6 to 9 ms and adds 8% to 11% of throughput. At 0.1 CPU Go serves 128 to 181 requests a second with a p99 of 300 to 500 ms at ten connections, where Rust stays near 100 ms. In exchange Go has the smallest image, a build about half as long as Rust's and a start as fast as Rust's at one CPU.
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 Rust and 2,500 on Go. 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 Rust keeps a median of 3 to 5 ms at ten connections and Go one of 2 to 95 ms, and both answer in about 100 to 200 ms at fifty. PHP responses are about twice the size of the Rust and Go 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 23 for Go, and Octane adds a resident worker at 61 to 78 MiB. The Rust image is 130 MB and the Go image 117 MB against 171 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 all three showcases live.
How it was done
I chose the method, the variants and the workloads, and I checked the results. I wrote the Go library, laravel-codicefiscale-go, with Claude Code and checked it by hand. Claude Code built the Go showcase, built the harness and extended it with the Go variant, 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, and Go about 28 times at one CPU and 22 at 0.1 CPU. Across the four workloads and three concurrencies at one CPU the factor is 23 to 43 for Rust and 18 to 28 for Go. At ten connections and one CPU the p50 is 2 to 3 ms on Rust, 1.1 to 1.5 ms on Go and 45 to 106 ms on PHP.
- Go's p99 at one CPU is 55 to 59 ms because the runtime uses two cores on a one-CPU quota and gets throttled. With
GOMAXPROCS=1the p99 drops to 6 to 9 ms and throughput rises 8% to 11%, and Rust stays ahead in throughput. On Render, warm, Rust and Go answer in the same 0.35 s. - 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 and Go gap reflects the whole stack. - The responses differ in size by about a factor of two because of markup, with the same visible content, and Go serves the same markup as Rust. After compression the gap is about 3 KB.
- Go gives the smallest image, 117 MB, a start as fast as Rust's at one CPU and a build about half as long as Rust's. Rust asks for a build 2.4 times as long as the deployed PHP image. Both frameworks are days old.
- These numbers come from one machine and one small app, with 26 of 96 original cells flagged for spread, mostly in tail latency, and 7 of 48 in the Go session. 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-rust-go-benchmark. The frameworks are laravel-rust and Laravel Go, the Go library is laravel-codicefiscale-go, the Go showcase is laravel-codicefiscale-go-showcase, 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.