Discarding AI-Generated Code [2026] - Dot Net Perls BlogHome<br>Categories<br>Blog<br>Discarding AI-Generated Code
Links<br>Updated Jun 8, 2026
Discarding AI-Generated Code<br>Jun 8, 2026There is a hot function in my Rust program that runs about a million times . Even a small change can cause the entire program to run faster or (more usually) slower.<br>Discarding CodeI used DeepSeek V4 Flash to explore many possible optimizations to this function. One of the first optimizations I added helped a bit. Unfortunately, none of the later ones did.<br>It seems even AI cannot bend reality to one's will. Optimizing an already-optimized function is sometimes just not possible . Later I did find a way to rewrite some surrounding code and speed up the program; and this I suppose counts as an optimization.<br>But it does sort of dispel my fantasies of super-intelligent AIs optimizing code in amazing ways. This is just not possible. Fortunately DeepSeek V4 Flash is very cheap, so many of the failed experiments did not cost me much. I discarded much of the AI-generated code.
Dot Net Perls features a blog that covers code from a higher level. It focuses on programming—and whatever the author is thinking about.<br>Consider donating to help offset the costs of running the server. Sites like this cease to exist without financial support.<br>Sam Allen is passionate about computer languages, and he is responsible for the material here. He hopes it makes the world a nicer place.
Home<br>Changes<br>© 2007-2026 Sam Allen