hn.today

Writing Rust code that's fast by asking agents to make the code faster

minimaxir.com96 points48 comments
Screenshot of Writing Rust code that's fast by asking agents to make the code faster

Commenters debated using agentic LLM loops to speed up Rust and other code. Several said agents shine when given a measurement harness: lordnacho and loeg described agents iterating through checklists, running perf, and documenting benchmarks to automate the grind, while hombre_fatal and minimaxir reported concrete wins when combining profilers and A/A or ABBA-style testing to steer agents. Some argued agents are already unmasking sloppy implementations and can often find obvious low-hanging fruit quickly; dasil003 and loeg noted you can get rapid improvements if you babysit the process and enforce statistical checks (T-tests, discard regressions). Suggestions for good practice included using perf/valgrind, ranking fixes by impact vs confidence, rerunning on varied inputs, and recording architectural decisions (ADRs).

Others pushed back on limits and failure modes. metalspot and bee_rider said agents reason poorly about deep low-level issues like cache behavior or hardware instructions and sometimes hallucinate implementations; ashkankiani complained agents rarely suggest building new tooling or dig into docs. pushpendraw and vatsachak warned of benchmaxxing - agents optimizing the harness rather than real workloads - and bespoke optimizations that don't generalize. Conscat and Capricorn2481 noted agents can loop unproductively or worsen metrics. The group split between optimism about tooling that shepherds agent iterations and skepticism that LLMs can replace expert judgement on difficult, trade-off‑laden performance work.

Read on minimaxir.com48 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in AI

No Sloptober

No Sloptober

No Sloptober challenges individuals to abstain from using LLM-based tools throughout October to develop personal skills and awareness of AI's limitations. Participants are encouraged to reflect on their reliance on AI, improve their coding abilities, and reassess the value of automation in their work and learning processes. (no-sloptober.com)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.