用大模型自动修复网页性能问题,效果因模型而异。
Evaluating the Use of LLMs for Automated DOM-Level Resolution of Web Performance Issues
- 用9个顶尖大模型分析网页DOM结构并提出优化方案
- 高阶模型使首屏加载等关键指标降低46.5%以上
- 但部分模型频繁出错,尤其影响视觉稳定性
用户期望网页快速流畅,但性能优化常耗时且依赖人工。本文聚焦文档对象模型(DOM)修改这一复杂任务,评估9个先进大语言模型在自动化解决网页性能问题上的表现。研究提取了15个热门网页(如Facebook)的DOM树,并通过Lighthouse获取性能审计报告,再将两者输入各模型进行修复。分析涵盖7类审计类别,结果显示模型在SEO与无障碍方面普遍表现优异;但在性能关键的DOM操作中效果不一:如GPT-4.1在初始加载、可交互性及网络优化上分别实现46.52%至48.68%的审计问题减少,而GPT-4o-mini则持续表现不佳。进一步分析发现,模型多采用添加元素和位置调整策略,且存在明显视觉稳定性退化问题。
原文摘要 · Abstract (English)
Users demand fast, seamless webpage experiences, yet developers often struggle to meet these expectations within tight constraints. Performance optimization, while critical, is a time-consuming and often manual process. One of the most complex tasks in this domain is modifying the Document Object Model (DOM), which is why this study focuses on it. Recent advances in Large Language Models (LLMs) offer a promising avenue to automate this complex task, potentially transforming how developers address web performance issues. This study evaluates the effectiveness of nine state-of-the-art LLMs for automated web performance issue resolution. For this purpose, we first extracted the DOM trees of 15 popular webpages (e.g., Facebook), and then we used Lighthouse to retrieve their performance audit reports. Subsequently, we passed the extracted DOM trees and corresponding audits to each model for resolution. Our study considers 7 unique audit categories, revealing that LLMs universally excel at SEO & Accessibility issues. However, their efficacy in performance-critical DOM manipulations is mixed. While high-performing models like GPT-4.1 delivered significant reductions in areas like Initial Load, Interactivity, and Network Optimization (e.g., 46.52% to 48.68% audit incidence reductions), others, such as GPT-4o-mini, notably underperformed, consistently. A further analysis of these modifications showed a predominant additive strategy and frequent positional changes, alongside regressions particularly impacting Visual Stability.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。