共 7 句 · 中英对照 · 对应本级 10 个目标词
开始练这一级 →Last week our team noticed that one dashboard had become slow to load, so we opened a ticket and started to collect data.上周我们团队发现有个仪表盘加载变慢,于是开了一张工单并开始收集数据。 The first profile showed a large render bundle, so we measured the time each viewport needed before it became interactive.第一次「性能剖析」显示「渲染」产出的包很大,于是我们测量了每个「视口」进入可交互状态所需的时间。
A teammate suggested lazy loading and code splitting for the heavy charts, but he warned that props drilling was still hiding the data flow.一位同事建议对体积大的图表使用「懒加载」和「代码分割」,但他提醒说「属性透传」仍然掩盖着数据流。 We also found that a single state change at the top of the page forced a full re-render of a large virtual dom tree.我们还发现,页面顶部的一次状态变更会迫使整棵庞大的「虚拟 DOM」树「重新渲染」。 The root cause was a shared parent, and the earlier fix had been a polyfill that pushed an old browser past its limit.根因是一个共享的父组件,而早先的修复是一个「垫片」,它把旧浏览器推到了极限。
After the release, the bundle size fell and the viewport became responsive again; no other metrics moved.发布之后,「包体积」下降了,「视口」重新变得灵敏,其他指标没有变化。
The lesson was simple: hot reload can hide this cost in development, so we now profile before we ship.教训很简单:「热重载」会在开发阶段掩盖这种代价,所以我们现在先做性能剖析再发布。
数据来源:NGSL(CC BY-SA 4.0)· ECDICT(MIT License)。短文为本项目为练习编写的配套材料。