Warp

6-Way AI Coding Showdown: Framework vs No-Framework Across PHP, Go, and Rust (Codex Controlled Benchmark)

8 min read

After publishing our Laravel Rust vs Laravel Go vs Laravel PHP runtime benchmarks, one comment kept popping up across X and YouTube:

"Why do you even need a framework in Go or Rust anymore? Just let an AI write Pure Go (net/http) or Pure Rust (axum). Frameworks are dead in the AI era."

It is a fair question — and one nobody seems to have actually measured under controlled conditions. Most debates about "Framework vs No-Framework with AI" rely on vibes, tiny "Hello World" demos, or letting the AI grade its own homework.

So we built a strictly controlled, memory-zero, 6-way AI coding benchmark covering 3 languages × Framework vs No-Framework:

Language With Framework Without Framework ("Pure")
PHP Laravel PHP (v13 + Laravel Boost) Pure PHP (PDO SQLite + PHPUnit)
Go Laravel Go v0.2.0 (go.laravel.com) Pure Go (net/http + modernc.org/sqlite)
Rust Laravel Rust 0.2.0 (laravel-rust) Pure Rust (axum + sqlx + serde)

What came back surprised us — because both sides of the internet argument turned out to be right, for completely different reasons.

6-Way AI Coding Showdown scoreboard comparing Pure PHP, Pure Go, Pure Rust, Laravel Go v0.2.0, Laravel PHP, and Laravel Rust 0.2.0
All 6 stacks passed 12/12 external black-box HTTP tests on the first run. No-framework ("Pure") stacks won wall time and used 3.6×–5.0× fewer input tokens — while Laravel frameworks cut actual application code by up to 50%.

1. Experimental Setup: Making the Benchmark Airtight

If you run AI coding benchmarks casually, subtle biases ruin the data: cached memories from previous runs, package download speeds skewing wall-clock time, or the AI writing weak tests that always pass. We eliminated every single one of those variables:

  1. Fixed Model & Reasoning Effort: Every run used codex-cli 0.172.0 pinned to gpt-6-astra with model_reasoning_effort = "medium".
  2. Cold-Start, Zero-Memory Isolation (CODEX_HOME): Before each stack started, our harness created a brand-new disposable TMP_CODEX_HOME directory containing only auth.json and a 2-line config.toml. No memories/, no sessions/, no history.jsonl, no personal AGENTS.md, no global skills/, and no hooks.json. As soon as a stack finished, the process exited and TMP_CODEX_HOME was deleted.
  3. Sequential Execution (Zero CPU Contention): All 6 stacks ran one after another on the same Apple M4 Max so cargo or go test never competed for CPU cores.
  4. Pre-Warmed Dependencies: Composer packages, Go modules, and Cargo crates were downloaded and pre-compiled before the timer started so network jitter never affected wall time.
  5. 100% Identical, Neutral Prompt (SPEC.md): Every stack received the exact same specification with zero hints about Laravel Boost, artisan, or CLI generators. If a framework provided AI aids (like Laravel Boost in laravel-php or starter docs in laravel-go / laravel-rust), Codex had to discover and use them autonomously.
  6. Independent 12-Point External Black-Box HTTP Contract Test: We did not trust Codex's own test suite alone. After each run finished, we booted every app as a live HTTP server on a fresh SQLite database and ran the exact same external Python HTTP verifier (verify_http.py) against all 6 live servers.

The Task: A Real-World Invoice Management API

Not a toy counter — a real business mini-app with 2 relational tables (invoices + invoice_items) and 5 endpoints:

  • POST /api/invoices — Nested line items, strict validation (422 with { "errors": { ... } }), unique invoice_number, server-computed total_cents inside a DB transaction (201).
  • GET /api/invoices — status filter, case-insensitive q search (invoice_number / customer_name), page & per_page pagination with { "data": [...], "meta": { "page", "per_page", "total" } }, id DESC, avoiding N+1 queries.
  • GET /api/invoices/{id} — Single invoice with nested items (200), or 404 when missing.
  • POST /api/invoices/{id}/transition — Strict state machine (draft → sent/void, sent → paid/void, paid and void terminal). Invalid transitions must return 422 and leave the DB untouched.
  • GET /api/invoices/export.csv — Same status/q filters, text/csv; charset=utf-8, Content-Disposition: attachment; filename="invoices.csv", proper CSV escaping for commas like "Acme, Inc.".
  • Automated Feature Tests: At least 8 required integration/feature test cases, all passing with 0 failures.

2. Full 6-Way Results Table

Every single stack completed the task with exit_code = 0, passed its own linter/test suite (pint, go vet, go test -race, cargo clippy), and passed 12/12 external black-box HTTP contract tests on the first run:

Stack Wall Time Cmds (Failed) Input Tokens (Cached) Output Tokens Invoice App LOC App Files Self Tests External Black-Box
Pure PHP (PDO) 209.4 s 6 (1) 157,671 (145,920) 9,422 272 4 47 pass 12/12 PASS
Pure Go (net/http) 233.8 s 10 (1) 307,912 (285,440) 9,677 476 2 12 pass 12/12 PASS
Pure Rust (axum) 236.9 s 6 (1) 266,773 (242,048) 9,888 478 3 12 pass 12/12 PASS
Laravel Go v0.2.0 241.4 s 19 (5) 1,121,265 (1,064,576) 8,871 301 (-37%) 9 13 pass 12/12 PASS
Laravel PHP (+Boost) 255.8 s 13 (4) 626,564 (567,040) 10,678 391 13 65 pass 12/12 PASS
Laravel Rust 0.2.0 256.9 s 19 (5) 1,340,789 (1,269,632) 8,462 238 (-50%) 9 14 pass 12/12 PASS

(Note: "Invoice App LOC" counts non-empty lines in invoice-related application source files, excluding vendor/target/tests and untouched starter boilerplate.)


3. Shock #1: No-Framework Won Speed, Retries, AND Input Tokens

If you had bet that a framework would make AI finish faster on a single feature, you would have lost that bet:

  • All 3 "Pure" stacks finished faster than all 3 Laravel stacks: Pure PHP (209.4s), Pure Go (233.8s), Pure Rust (236.9s) vs Laravel Go (241.4s), Laravel PHP (255.8s), Laravel Rust (256.9s).
  • 3.6× to 5.0× fewer input tokens:
    • Pure PHP used 157,671 input tokens vs Laravel PHP's 626,564 (4.0×).
    • Pure Go used 307,912 vs Laravel Go's 1,121,265 (3.6×).
    • Pure Rust used 266,773 vs Laravel Rust's 1,340,789 (5.0×).
  • Only 1 failed shell command per Pure stack vs 4–5 failed commands per Laravel stack.

Why did that happen? Look inside the Codex event logs:

  1. Pretraining familiarity is a superpower: gpt-6-astra knows PHP PDO, Go net/http, and Rust axum/sqlx cold. In pure-php, pure-go, and pure-rust, there was almost nothing to read — Codex went straight to writing files and hit zero API surprises.
  2. Brand-new v0.2.0 frameworks incur a doc-reading tax: Because Laravel Go v0.2.0 and Laravel Rust 0.2.0 were released this week, Codex did not have their exact APIs memorized. It spent extra commands grepping ~/go/pkg/mod/go.laravel.com@v0.2.0/docs/ and ~/.cargo/registry/src/.../laravel-rust to verify exact method signatures (like LazyByIDDesc or laravel::http::Created), racking up 1.1M–1.34M input tokens (though >94% were prompt-cached).
  3. Laravel Boost actually worked — and added upfront context: Even without any hint in the prompt, Codex in laravel-php autonomously discovered .agents/skills/laravel-best-practices/ installed by Laravel Boost, read the guidelines, and then wrote an astonishing 65 feature tests (400 assertions) following Laravel's full MVC structure (FormRequest, JsonResource, Enum, Service, Controller, Migrations).

4. Shock #2: Frameworks Cut Application Code by Up to 50%

Now flip the table and look at how much application code Codex actually had to write — and the output tokens it generated:

  • Laravel Rust 0.2.0 wrote just 238 LOC — the smallest application footprint of all 6 stacks, literally 50% less code than Pure Rust (478 LOC), and the lowest output tokens (8,462) of all 6 runs!
  • Laravel Go v0.2.0 wrote 301 LOC — 37% less code than Pure Go (476 LOC), and the 2nd-lowest output tokens (8,871)!
  • Pure Go (476 LOC in 2 files) and Pure Rust (478 LOC in 3 files) had to hand-roll everything from scratch inside monolithic files:
    • Custom HTTP routing & path parameter parsing
    • Custom SQLite schema initialization & PRAGMA foreign_keys
    • Custom email regex, YYYY-MM-DD calendar validation, nested item loops, and 422 error JSON builders
    • Custom dynamic WHERE clause building for search + filter + pagination
    • Custom test harness setup
Side-by-side comparison of No-Framework vs Framework code produced by Codex across PHP, Go, and Rust
No-framework wins cold-start speed and input tokens on a single feature; frameworks cut per-feature app code by up to 50% and enforce uniform API contracts and clean MVC structure.

5. The Hidden Difference: API Contract Consistency & Maintainability

Look at the exact HTTP 422 response returned by our external black-box test 04_duplicate_number_422 across all 6 live servers:

  • Laravel PHP: {"message":"The invoice number has already been taken.","errors":{"invoice_number":["The invoice number has already been taken."]}}
  • Laravel Go v0.2.0: {"message":"The invoice number has already been taken.","errors":{"invoice_number":["The invoice number has already been taken."]}}
  • Laravel Rust 0.2.0: {"message":"The invoice number has already been taken.","errors":{"invoice_number":["The invoice number has already been taken."]}}

Byte-for-byte identical across PHP, Go, and Rust!

Now look at the 3 No-Framework ("Pure") servers:

  • Pure PHP: {"errors":{"invoice_number":["This invoice number is already in use."]}}
  • Pure Go: {"errors":{"invoice_number":["has already been taken"]}}
  • Pure Rust: {"errors":{"invoice_number":["This invoice number is already in use"]}}

Every Pure stack invented its own ad-hoc error envelope, its own wording, its own validation helper, and stuffed the entire feature into 2–4 monolithic files.

On Feature #1, that feels fast and clean. On Feature #25 — when a second developer (or a fresh AI session with zero memory!) adds Orders, Refunds, Customers, Auth, Roles, Audit Logs, and Queues — every ad-hoc pattern starts drifting unless you accidentally build your own undocumented mini-framework.


6. The Honest Verdict: When Should You Use a Framework in the AI Era?

The answer is no longer ideological — it is pure math:

  • Skip the framework (Pure PHP / Pure Go / Pure Rust) when:
    • You are building a 1–3 endpoint microservice, webhook receiver, proxy, or CLI tool.
    • AI already knows PDO, net/http, and axum cold — you get 10–20% faster generation, 1/4th the input tokens, and zero framework learning curve.
  • Use a framework (Laravel PHP / Laravel Go / Laravel Rust) when:
    • You are building a real business application with 10, 50, or 100+ endpoints, migrations, auth, queues, and long-term maintenance.
    • The upfront doc-reading tax is paid once — while the 37–50% reduction in per-feature application code, clean 9–13 file structure, and byte-for-byte consistent validation/error contracts compound on every single feature you ship for years.
  • And notice the surprise winner inside the framework group:
    • Laravel Rust 0.2.0 produced the smallest application code (238 LOC) and fewest output tokens (8,462) of all 6 stacks — proving that Rust's declarative macros (#[laravel::input], model attributes) let AI express complex business logic in remarkably few lines once the docs are in context.
    • Laravel Go v0.2.0 was the fastest framework overall (241.4s) with just 301 LOC — only 7.6 seconds behind Pure Go, while keeping a clean 9-file Laravel architecture.
    • Laravel PHP (+Boost) delivered the deepest test suite by far (65 feature tests, 400 assertions) because Codex autonomously discovered and followed Laravel Boost's best-practice rules.

Combined with our 11-test runtime & DX benchmark guide, the full picture is now crystal clear: Laravel Rust 0.2.0 owns raw runtime speed and terse macro-driven code; Laravel Go v0.2.0 owns the daily build/test/deploy loop; Laravel PHP owns the mature ecosystem; and No-Framework Pure stacks win tiny single-purpose services.

More from the blog

Reading 100 Open PRs on Laravel for Go — And Submitting Our First Performance PR (#421)

After benchmarking Laravel Go v0.2.0, we profiled its validation hot path, submitted PR #421 to laravel/go-framework, and read through 100 open PRs. Here is what stood out — from @mattn's 3-line hot-path fixes to Blade, Wayfinder, and native OTLP.

See who is free next week and book them, in Filament

An agency manager needs 40 hours for a project that starts Monday. The planner shows only the people who have the time, the booking is a drag, and the overbooked project manager gets a fix in two clicks.

Laravel Rust vs Laravel Go vs Laravel PHP: The Complete Real-World Benchmark Guide

We benchmarked Laravel Rust (0.1.4 → 0.2.0), Laravel Go (v0.1.0 → v0.2.0), and Laravel PHP (FPM, FrankenPHP, Swoole, Workerman) across 11 real workloads — from $5 VPS survival and heavy ORM to nested JSON validation and daily DX. Continuously updated as new releases ship.

Filament + AI coding tips, by email

How to fit Warp plugins into your own app and pair them with Claude Code or Cursor: prompts that work, mistakes AI makes, real examples. Once or twice a month. Unsubscribe anytime.

Ask us anything about Warp

No email address or sign-up needed.

We read every question and answer here on the site, usually within a day. Others see your question after we have checked it.

What's stopping you from using Warp's plugins?

One question. We read every answer, and it decides what we build next. It is not shown on the site.

What's stopping you from using Warp's plugins?