The debate over whether AI agents render traditional web frameworks obsolete has finally been quantified. A new benchmark published on DEV.to compared six distinct stacks using Codex CLI 0.172.0 pinned to the gpt-6-astra model. The experiment tested PHP, Go, and Rust in both Pure configurations and Laravel-branded framework variants to determine if AI-generated code benefits from structural scaffolding or raw language primitives.

The Setup: Airtight Conditions for a Real-World Task

To eliminate the usual biases in AI coding benchmarks, the researchers implemented a strict memory-zero isolation protocol. Each run utilized a disposable temporary directory for Codex configuration, ensuring no prior memories, session histories, or global skills influenced the output. The task was not a trivial Hello World but a complex Invoice Management API requiring nested line items, state machine transitions, and CSV exports. All six stacks successfully passed 12/12 external black-box HTTP contract tests, validating that the generated code was functionally correct across the board.

Speed vs. Volume: The Framework Paradox

The results highlight a critical trade-off that developers must understand. The Pure stacksβ€”using standard libraries like Go's net/http and Rust's axumβ€”finished generation significantly faster than their framework counterparts. Pure PHP completed in 209.4 seconds, compared to Laravel PHP's 255.8 seconds. More importantly, the Pure stacks consumed 3.6Γ— to 5.0Γ— fewer input tokens. This efficiency stems from the model's pretraining familiarity with standard libraries, allowing it to write code immediately without needing to read documentation. However, the frameworks excelled in output efficiency. Laravel Rust 0.2.0 generated only 238 lines of code, which is 50% less than the 478 LOC produced by Pure Rust. Laravel Go v0.2.0 generated 301 LOC, a 37% reduction compared to Pure Go's 476 LOC. The frameworks forced the AI to handle boilerplate and validation logic, resulting in leaner application files despite the higher token cost for documentation retrieval.

Consistency and the Hidden Cost of Ad-Hoc Patterns

Beyond raw metrics, the benchmark exposed a subtle but dangerous difference in API contract consistency. When handling duplicate invoice errors, all three Laravel stacks returned byte-for-byte identical JSON responses. In contrast, the Pure stacks drifted in their error formatting, with slight variations in message text and structure. While this drift might seem negligible in a microservice, it compounds in larger applications where new features or AI sessions might introduce further inconsistencies, effectively forcing teams to build undocumented mini-frameworks to maintain uniformity.

Key Takeaways

  • Use Pure stacks (net/http, axum, PDO) for microservices and CLI tools where speed and low token costs are prioritized.
  • Use Frameworks (Laravel PHP/Go/Rust) for complex business applications where code volume reduction and API consistency are critical.
  • AI models incur a documentation tax when using brand-new framework versions, such as Laravel Go v0.2.0, increasing input token usage significantly.
  • Pre-Warmed dependencies and sequential execution on an Apple M4 Max were essential for accurate wall-clock timing.

The Bottom Line

Frameworks are not dead in the AI era; they are simply changing roles. While Pure stacks win on raw generation speed for small tasks, the documentation tax is a one-time cost that pays dividends in maintainability and consistency for larger applications. If you are building a real business app, the code reduction and contract stability provided by frameworks like Laravel outweigh the initial token overhead.