Hacker News ★ 88 6 min

Once Claude can measure something, it can make it faster

🔗 https://claude.dev/blog/how-we-made-claude-ai-faster/

📌 【Anthropic】把 Claude 變成自己的效能工程師,兩週讓 claude.ai 快 3 倍

TL;DR:Anthropic 讓 Claude 自主找瓶頸、寫 benchmark、上線修復,兩週內把 claude.ai 平均加速 3.1 倍。

使用者一直在抱怨 claude.ai 太慢,而 Anthropic 團隊的做法很不尋常:不是直接派工程師去排查,而是開一個 Slack channel,把 Claude 放進每一個討論串,讓它自己去找瓶頸、驗證假設、寫程式修,人類只負責定目標、做取捨、審核每一個變更。

🤔 一個 Slack channel,一個常駐指令

團隊在衝刺開始前只給 Claude 一段標準指令:你的工作是負責 claude.ai 網站與桌面 app 的效能,包括監控每次部署有沒有效能退化、評估現有 telemetry 是否準確完整、維護觀測儀表板、主動修復觀察到的問題與唾手可得的改善、提出效能專案構想,並與人類隊友溝通。文章特別寫明,終極目標是讓這個 channel 盡可能自主運作,「但今天我們知道還做不到」。

🧩 先找出 95% 使用量集中在哪四段旅程

Claude 透過 Datadog MCP server 分析使用資料,找出四個涵蓋 95% 使用者活動的關鍵旅程:啟動 app、開始新對話、載入既有對話、傳送訊息。橫跨 web 與桌面、以及不同產品線,這四段旅程共拆解出十三項可直接比較的量測指標。團隊為每個指標補齊 instrumentation,確保「使用者互動開始」到「結果渲染完成」之間的量測是可比的,並區分出 client 端與 server 端各自的耗時。

衝刺一開始,團隊列出約二十個針對特定旅程的候選專案,由 Claude 估算每個專案能省下多少毫秒,據此設定衝刺目標。結果到第三天,十三項目標裡已經命中十二項——原訂計畫提前完成後,團隊把剩下的時間交給 Claude 自己去找新的優化空間,包括「開放接受各種瘋狂點子」。

📊 十三項指標,平均快 3.1 倍

以下是 8 月 13 日與 8 月 27 日的 p75 real user monitoring 對比:

旅程平臺優化前優化後加速倍數
啟動 appclaude.ai web 冷載入3,085 ms550 ms5.6x
啟動 app桌面 app 冷啟動6,310 ms3,328 ms1.9x
開始對話Chat web416 ms273 ms1.5x
開始對話Chat 桌面460 ms224 ms2.1x
開始對話Claude Code 桌面837 ms347 ms2.4x
載入對話Chat web1,557 ms646 ms2.4x
載入對話Chat 桌面1,353 ms488 ms2.8x
載入對話Claude Cowork 桌面雲端2,566 ms728 ms3.5x
載入對話Claude Code 桌面545 ms262 ms2.1x
傳送訊息Chat web180 ms59 ms3.1x
傳送訊息Chat 桌面140 ms64 ms2.2x
傳送訊息Claude Cowork 桌面雲端928 ms48 ms19x
傳送訊息Claude Code 桌面250 ms52 ms4.8x

十三項指標的幾何平均加速為 3.1 倍。團隊估算,這樣的改善每天能為使用者省下數萬小時的等待時間。具體改動包括:把靜態輸入框直接烤進 HTML,讓使用者在 React 初始化期間就能打字;為桌面殼層預先編譯 V8 code cache,避免主程序每次都要重新編譯;切換對話時保持輸入框不卸載;使用者滑鼠懸停時預先抓取該對話的 session;以及把側邊欄的 re-render 次數砍掉 90%。

💡 當「毫秒」太吵,就換一把尺

團隊很快發現一個限制:wall-clock 時間會受使用者真實感受影響,但雜訊太大,不適合當 CI 的硬性門檻。於是他們和 Claude 一起找出一整套確定性(deterministic)的替代量測:純 JS 熱路徑用 Valgrind 搭配 node --predictable 數指令數;瀏覽器路徑則用 React commit 次數、V8 precise coverage 的函式呼叫次數、layout/style 重新計算次數、DOM mutation 次數這一整串「梯子」。但每一個新 benchmark 都被要求先證明自己真的能追蹤真實的 wall-clock 延遲,團隊甚至明講:如果某個 benchmark 沒辦法證明能帶來可量測的實際加速,就會被下架,避免 Claude 爬錯山頭。例如,團隊要求 Claude 用指令計數去優化「組裝對話訊息樹」的例行程式,以及 Claude Code 輸出中的狀態列掃描器,並先驗證指令數下降確實對應到真實延遲下降。

📊 三千多次變更,零客戶可見事故

整個衝刺期間,團隊用的是內部研究模型「Claude Tag(beta)」,能力大致相當於 Opus 5.5。過程中合併了超過三千個變更,沒有發生任何客戶可見的事故或回滾。人類團隊的角色始終是設定目標、做取捨判斷、審核每一個實際上線的變更。

🎯 實務啟示

這個案例對做效能優化的工程團隊有兩個可直接借鏡的地方:第一,把「模糊的抱怨(很慢)」轉成「95% 使用量集中在哪四段旅程」這種可量測、可分解的問題,是任何優化工作的起點,不論執行者是人還是 AI。第二,當 wall-clock 太吵不適合當 CI gate 時,找一把「確定性但需要先驗證與真實延遲相關」的替代尺規,比盲目相信某個看起來合理的代理指標更可靠——這條「先證明相關性,再拿來當門檻」的紀律,本身就是值得搬進團隊流程的做法。

🔗 來源

#Anthropic #ClaudeAI #PerformanceEngineering #WebPerf #AIAgents #DeveloperProductivity #Observability #RUM #FrontendPerformance #AIOps

原始資料 Hacker News · 收集於 2026-09-24
來源原標題
Once Claude can measure something, it can make it faster
作者
matthieu_bl
原始標籤
hackernews
來源訊號
HN points 220 HN 留言 148
原始連結
https://claude.dev/blog/how-we-made-claude-ai-faster/

摘要原文

This August, we made the core user experience of claude.ai and the Claude desktop app about 3x faster in a two-week sprint. Users had been telling us it was slow, and they were right. We ran everything from a single Slack channel, with Claude in every thread. We focused on four journeys that make up 95% of user activity. At the 75th percentile, time to a typeable page on a fresh load of claude.ai went from 3.1 seconds to 0.55, starting a new Claude Code session went from 0.8 seconds to 0.3, and loading a Claude Cowork cloud session went from 2.6 seconds to 0.73. In aggregate, we estimate that saves tens of thousands of user-hours of waiting every day. Core user journeys, p75 Real user monitoring, per platform and product, August 13 vs. August 27 Launching the app claude.ai web · fresh load 5.6x faster −82% 3,085 → 550 ms Desktop app cold start 1.9x faster −47% 6,310 → 3,328 ms Starting a conversation Chat web 1.5x faster −34% 416 → 273 ms Chat desktop 2.1x faster −51% 460 → 224 ms Claude Code desktop 2.4x faster −59% 837 → 347 ms Loading a conversation Chat web 2.4x faster −59% 1,557 → 646 ms Chat desktop 2.8x faster −64% 1,353 → 488 ms Claude Cowork desktop · cloud 3.5x faster −72% 2,566 → 728 ms Claude Code desktop 2.1x faster −52% 545 → 262 ms Sending a message client-side share Chat web 3.1x faster −67% 180 → 59 ms Chat desktop 2.2x faster −54% 140 → 64 ms Claude Cowork desktop · cloud 19x faster −95% 928 → 48 ms Claude Code desktop 4.8x faster −79% 250 → 52 ms Thirteen measurements across four journeys, before and after: 3.1x faster on average (geometric mean). Core user journeys, p75 Real user monitoring, per platform and product, August 13 vs. August 27 Launching the app claude.ai web · fresh load 5.6x faster −82% 3,085 → 550 ms Desktop app cold start 1.9x faster −47% 6,310 → 3,328 ms Starting a conversation Chat web 1.5x faster −34% 416 → 273 ms Chat desktop 2.1x faster −51% 460 → 224 ms Claude Code desktop 2.4x faster −59% 837 → 347 ms Loading a conversation Chat web 2.4x faster −59% 1,557 → 646 ms Chat desktop 2.8x faster −64% 1,353 → 488 ms Claude Cowork desktop · cloud 3.5x faster −72% 2,566 → 728 ms Claude Code desktop 2.1x faster −52% 545 → 262 ms Sending a message client-side share Chat web 3.1x faster −67% 180 → 59 ms Chat desktop 2.2x faster −54% 140 → 64 ms Claude Cowork desktop · cloud 19x faster −95% 928 → 48 ms Claude Code desktop 4.8x faster −79% 250 → 52 ms Thirteen measurements across four journeys, before and after: 3.1x faster on average (geometric mean). We used Claude Tag (beta), running an internal research model roughly comparable to Opus 5.5. Claude found bottlenecks, built benchmarks, shipped improvements, and watched every deploy. We steered by setting goals, making tradeoffs, and approving every change. With that approach, we merged more than three thousand changes without a single customer-facing incident or rollback. This post covers what we shipped, how we measured it, and the loop we built with Claude to do it safely. THE BRIEF Before the sprint, we created a Slack channel with the following standing instructions : @Claude Your job is to facilitate all things related to the performance of the claude.ai website and desktop app. Your responsibilities include monitoring deploys for performance regressions, assessing the accuracy and comprehensiveness of existing telemetry, maintaining well-curated observability dashboards, proactively implementing solutions for observed issues and low-hanging fruit, proposing performance project opportunities, and communicating with your human teammates. […] The ultimate goal for this channel is for you to become as autonomous as possible, but today we know that isn’t yet possible. We asked Claude to analyze usage data through the Datadog MCP server. It identified the four highest-impact user journeys: launching the app, starting a conversation, loading an existing conversation, and sending a message. Between web and desktop, and across our products, those journeys came to thirteen distinct measurements. To establish baselines, we added instrumentation until they were directly comparable: each started with a user interaction, ended once the result was rendered, and disambiguated client and server work. We kicked off the sprint with a list of about twenty hand-picked projects, each targeting a specific journey. Claude estimated the impact of each project in milliseconds, and we aggregated those estimates to set our targets for the sprint. Some of the projects were fairly large, but we thought we could probably achieve most of them within two weeks. We hit twelve of the thirteen targets by day three. The planned projects landed early. For faster launches, we baked a static composer into the HTML so users can type during React initialization, and precompiled a V8 code cache so the desktop shell’s main process doesn’t recompile from scratch. For faster navigations, we kept the composer mounted between conversations, prefetched sessions when the user hovered over them, and cut sidebar re-renders by 90%. We had also left room for Claude to identify opportunities and propose new workstreams. Those workstreams quickly ramped into full projects of their own, which far exceeded our initial targets. So we set new targets, then looked for more things to measure: @Claude we’ve ended up funding nearly every project in the original projects list and more. let’s do a refresh […] what have we not explored, what can we hill climb on, where is the most opportunity at this point? […] i am open to WACKY ideas ANYTHING CAN BE HILL CLIMBED From the start, we knew we wanted to iterate faster than our deploy cadence. Claude could work asynchronously for many hours, even overnight, and we wanted to let it validate its prototypes without waiting for field reads. To achieve that, we looked for other ways to measure performance in the lab. Sam found the first lead: # claude-apps-perf · thread S Sam 12:34 PM What can we do instead of wall-clock timing? Can we measure JS instruction counts for instance? Claude App 12:42 PM Yes. For pure-JS hot paths, literal instruction counts: run the benchmark under Valgrind with node --predictable and compare to a checked-in baseline — one run, no statistics needed. For browser paths there’s no instruction counting under Chromium, but there’s a ladder of other deterministic counts: React commits per interaction, function call counts from V8’s precise coverage, layout and style-recalc counts, DOM mutations. Which do you want first? S Sam 12:49 PM Let’s explore valgrind + Ir + --predictable in one thread and each of the browser/react benches in new threads. Ping me in all of them. You know what we want. Let’s go Recreated from a real conversation. Eleven minutes later, five threads were running, each focused on a different measurement: instruction counts, V8 call counts, React commits, style recalculations, and DOM mutations. We treated every new benchmark with some skepticism. Each one had two jobs: first, a metric Claude could move in the lab; second, a guardrail in CI with a number that could only ratchet down. If a benchmark was flaky, or if it didn’t actually correlate with user latency, we threw it out rather than let Claude climb the wrong hill. @Claude please prove that hill climbing against each of these can result in measurable wall clock perf wins. we’ll unship the benches for any candidates that cannot prove that Wall-clock time is what users feel, but it’s noisy, and milliseconds are too flaky to use as a CI gate. Instruction counts were appealing because they were deterministic, but we still needed Claude to prove they tracked wall-clock time. So we asked Claude to drive the count down on two hot paths: the routine that assembles a conversation’s message tree, and a scanner for status lines in Claude Code output. (220 points, 148 comments on Hacker News)

由 claude-code/sonnet 自動生成