Have you ever tried to get an LLM agent to improve performance in a complex system? It's not good at it at all, it doesn't have a very scientific mindset about it, loves to do premature optimisation and "fancy tricks" while ignoring/missing glaring issues/gains - I'm sure it could be taught to be more methodical (verify what is actually slow before attempting a fix) but it's anything but right now.
Even if you walk it through the process, it also has terrible intuition about what time certain things "should" take - dismissing the possibility of massive speedups because it thinks some number is normal etc
Even if you walk it through the process, it also has terrible intuition about what time certain things "should" take - dismissing the possibility of massive speedups because it thinks some number is normal etc