基准测试比较12种JavaScript框架方案的AI开发成本
Nolan Lawson 让 AI 智能体使用 12 种 JavaScript 框架方案构建同一个基于 PokéAPI 的宝可梦应用,并比较估算 API 成本、Token 消耗、开发时间、代码规模及 Lighthouse 指标。Hono+htmx 的中位估算成本最低,为 2.67 美元;Angular 为 4.97 美元,Token 消耗约 976 万,而 Hono+htmx 约为 426 万,但各次运行结果存在明显波动。Lawson 强调,这个单一且交互较简单的内容型应用不能形成适用于所有项目的框架排名。
该基准提供了比较性证据,显示框架选择可能影响 AI 编程成本、开发时间、生成代码规模和网页性能。由于实验仅覆盖一个相对简单的应用、成本为估算值且各次运行存在波动,结论的适用范围受到限制。
One of my pet peeves with the web development community is that so many of the decisions we make are vibes-based. Frameworks are “blazing fast,” tools will “supercharge” your development, the right abstraction will benefit both you and your users (DX and UX all in one!). All of this breathless boasting is usually offered with zero evidence. Alex Russell has called this “frontend’s lost decade”, Baldur Bjarnason has called programming a pop culture, and I’ve tried to counter this trend in my blog with facts and benchmarks (at my best, anyway).
For a long time it seemed like our community’s allergy to evidence was driven by the desire for greater DX. In other words, devs just liked the way it felt to type JSX in React, and the arguments promoting React or related tools (“the virtual DOM is fast!”) were largely post-hoc rationalizations to justify those initial gut feelings. (Jonathan Haidt would likely agree with this assessment.)
But in the agentic era, when developers are no longer typing code by hand and are thus less constrained by DX, I still see vibes ruling the day (and not just in the sense of “vibe-coding”). Frontends are rewritten because some framework or another is “better for agents.” (Did anyone think to ask the agents?) The resulting code is “faster,” the agents make “fewer mistakes,” etc. Once again, these claims are often made without evidence. Whenever I read one of these accounts, I think to myself, “Where are the benchmarks?”
#Angular#Astro#Gracile+Lit#Hono+htmx#Next.js#Nuxt#Qwik#React Router#SolidStart#SvelteKit#TanStack Start#Claude Opus 5.5