Move faster, wait less: Improving code review time at Meta
Meta found that the slowest 25% of code reviews (P75 Time In Review), not the median, correlated with engineer dissatisfaction, so it made P75 its north-star metric and used "Eyeball Time" as a guardrail against rubber-stamp reviews. Three experimentally validated features followed. Next Reviewable Diff uses ML to queue a relevant diff after each review and raised daily review actions by 17%. A rebuilt reviewer recommender that accounts for work hours and file ownership lifted top-3 accuracy from under 60% to nearly 75% and ran 14x faster at P90. Nudgebot pings likely reviewers on stale diffs, cutting average Time In Review by 7% and diffs waiting over three days by 12%.
Related posts
- AI Lab: The secrets to keeping machine learning engineers moving fast
Meta Engineering mediumAdeptMeta's AI Lab is a pre-production framework that continuously runs shrunk, often CPU-only versions of common ML training workflows as A/B tests to measure time to first batch (TTFB), the delay from job submission to the first training batch. It catches regressions before release and lets infra owners validate improvements in under an hour. During the Cinder Python runtime rollout, it helped engineers double their TTFB gains, reaching up to 40%, for example by fixing memoization that triggered expensive repr() calls. It also caught an unrelated blocking-logging regression and attributed it to the specific change. To scale, it runs cheap tests on code changes and broader tests with bisect-style attribution on releases, flagging changes via t-tests, confirmation runs and ROC-tuned thresholds that cap false positives.
- Better tools made Copilot code review worse. Here’s how we actually improved it.
GitHub Engineering mediumAdeptSwapping Copilot code review's bespoke exploration tools for the shared Copilot CLI tools (grep, glob, view) initially raised review cost and reduced useful comments, because the tool instructions encouraged broad, repo-browsing behavior instead of diff-anchored investigation. Benchmark traces exposed the browsing loop, and rewriting tool guidance around a reviewer's workflow (form questions from the diff, narrow with grep/glob, batch discovery, view only known ranges, recover from failed searches with simpler queries or glob) cut average review cost about 20% in production without a quality regression. The same focused instructions did not help the interactive CLI, so tool prompting must match the product's job.
- How we improved availability through iterative simplification
GitHub Engineering mediumAdeptGitHub cut timeouts in its Rails monolith with small, measured changes found through Datadog metrics, Splunk logs and custom MySQL slow-query monitors. Each change was validated with Scientist experiments or rolled out gradually behind Flipper feature flags. Reordering a Command Palette query to look up a user's contributions before filtering by org removed a large IN clause and was 80-90% faster, and batching access checks added another 20-80% and 30-40%. Skipping unneeded authorization filters on a busy redirect endpoint cut tail latency and timeouts. Not every idea paid off: moving sorting into the application was 40-80% slower, so that experiment was dropped.
- Leveraging AI for efficient incident response
Meta Engineering mediumAdeptMeta's AI-assisted root cause analysis system narrows suspect code changes in its web monorepo by combining a heuristic retriever with a fine-tuned Llama 2 (7B) ranker. The retriever uses signals such as code and directory ownership and the runtime code graph to cut thousands of changes down to a few hundred. The ranker then runs an 'election': each prompt holds up to 20 changes and picks the top five, and results are aggregated and repeated until five candidates remain. Backtesting shows the root cause lands in the top five for 42% of investigations at creation time. The biggest gain came from continued pre-training on internal artifacts plus supervised fine-tuning on about 5,000 historical RCA examples, including logprob-ranked list outputs, while confidence thresholds suppress low-confidence suggestions in favor of precision.
- Improving machine learning iteration speed with faster application build and packaging
Meta Engineering mediumAdeptMeta cut ML engineers' build and packaging overhead by double-digit percentages by tackling build non-determinism, pruning dependencies, and replacing monolithic XAR executables with an incremental Content Addressable Filesystem (CAF). Non-determinism from compilers and build rules is mitigated inside the Remote Execution service that Buck2 sends nearly all build actions to, so stable warm revisions can reuse cached outputs. CAF describes each executable as a flat manifest of content digests, skips uploads already in CAS, and fetches only missing content via per-host CAS daemons that share data peer-to-peer over Owl. Btrfs compression and copy-on-write keep on-disk size close to XAR while sharing files across executables. Planned next steps are lazy on-demand fetching (LazyCAF) and putting all ML engineers on uniform revisions to raise cache hit rates.