π§ Models and how they work Β· β±οΈ 2 min Latte βββββ
What is Profiling?
π The slightly longer version
Profiling means measuring a running program to see where its time goes. A tool called a profiler watches the app while it works. It counts how often each function runs and how long each one takes. A function is a small named piece of code that does one job.
The result is often surprising. In many apps, a small part of the code uses most of the time. The fast-anything project uses this idea. It profiles an app written in Python, Node or Ruby, finds the slow functions, and lets a coding agent rewrite only those in Rust, a faster language. Then it checks that the new code behaves the same as the old code. So you fix the slow parts, not the whole program.
How profiling guides a partial rewrite
- Run the appThe app does its normal work while a profiler watches.
- Measure each functionThe profiler records how often each function runs and how long it takes.
- Find the hot spotsA few slow functions usually stand out at the top of the list.
- Rewrite only thoseA coding agent ports just the slow functions to a faster language.
- Check same behaviourTests compare old and new code, then a human reviews.
A full rewrite of an app is long, costly and risky. Profiling tells you where the real problem is, so a team can spend effort on a few functions instead of everything. With fast-anything, it also decides which code an AI agent will touch, so it is good to understand what drives that choice.
β οΈ What to watch out for
A profile only shows what happened during the test run. If the test does not look like real use, you may speed up the wrong part. The project's idea of rewriting only the slow part of an app sounds great, but it comes from the project itself, not from independent tests. And even when tests say the new code matches the old one, a test can miss a case, so a human should still review agent-written code.
π° Where it showed up
This notion came up in A city manager let ChatGPT write the laws for 20,000 people. Who checked?. More lessons: Learn.
π― Keep learning
Sources
Written on 2026-11-27. This explanation was accurate on that day. AI changes fast, so check the sources and the date before you rely on it.
Get The AI Daily Grind by email, every morning, in simple words.