GoogleGeorge Weale, Bo Yang, Andrew BiernatProblem & solution
Optimizing a 200,000-line Python codebase overnight with Gemini 4 Argon
Summary
Google tested Gemini 4 Argon on google/adk-python, a 205,000-line Python framework with 800 source files and 17,000 unit tests. The model ran unattended for 11 hours, guided by a /goal prompt and .agents/skills rulefiles that encoded maintainer conventions. Argon first wrote a benchmark script, spent 70 minutes measuring before editing code, and proposed six optimizations across 32 files; two shipped after human code review. The shipped changes cut in-memory session prep time by about 40% in long sessions and sped up cold package imports by 21% by filtering events before copying and using lazy module accessors. The other four proposals were rejected for relying on fragile state, private library internals, or synthetic-only gains, illustrating a division of labor where the agent explores and the maintainer subtracts.
Context
Google tested Gemini 4 Argon on google/adk-python, a 205,000-line Python framework for building enterprise agents. The goal was to see if the model could find and fix cross-file performance bottlenecks unattended overnight.
Approach / What changed
The approach used a /goal prompt in Google Antigravity to keep the model running until the task was finished, combined with .agents/skills rulefiles that encoded maintainer conventions. The model first wrote a benchmark script, spent 70 minutes measuring, then proposed six optimizations. Two shipped after human code review: filtering session history before copying and lazy-loading heavy packages.
Takeaways
Gemini 4 Argon proposed six optimizations across 32 files; only two shipped after human code review, illustrating that AI-generated code still requires human judgment for maintainability and safety.
The shipped changes cut in-memory session prep time by about 40% in long sessions and sped up cold package imports by 21% by filtering events before copying and using lazy module accessors.
The model’s first round without repository conventions produced code that missed maintainer rules, while the second round with .agents/skills and /goal mode produced a review-ready pull request that ran all 16,892 unit tests.
FAQ
What optimizations did Gemini 4 Argon propose for ADK?
Argon proposed six optimizations across 32 files. Two shipped: filtering in-memory session history before copying and lazy-loading heavy packages. The other four were rejected for relying on fragile state, private library internals, or synthetic-only gains.
How much performance improvement did the changes achieve?
The changes cut in-memory session prep time by about 40% in long sessions and sped up cold package imports by 21%. Time from a new process to first model request stayed flat at 3.07 to 3.09 seconds because deferred modules load on the first turn.
What was the workflow for running Gemini 4 Argon on the codebase?
The workflow used a /goal prompt in Google Antigravity to keep the model running until the task was finished, combined with .agents/skills rulefiles that encoded maintainer conventions. The model ran unattended for 11 hours, first writing a benchmark script and measuring before editing code.
Source and freshness
- Source
- developers.googleblog.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.