Re: Await Fix
I disagree there. The AI did almost the same kind of thing that I would have done. I wouldn't have done the first step, because my bias is always to do things incrementally when possible to avoid wasting space, but the rest of the steps match my typical workflow:
Stage 1: You want a solution to your problem. Write some code that solves the problem.
Stage 2: You want the code to run faster. Identify the simplest bottleneck in the code I wrote and fix it, again as quickly as possible.
Stage 3: Improve the tools I'm using to speed it up.
Stage 4: Can I parallelize?
The code didn't bother with stage 5: try to find ingenious mathematical solutions to get it done faster, and it probably couldn't find any. It instead used a different stage 5: add extra stuff nobody asked for. However, the progression otherwise makes sense. I also tend to try to get some information before starting this process on how fast the code needs to be so if you need stage 3 performance, I don't bother with the first two. Since many problems are just fine with stage 1 performance*, it isn't automatically bad to start there.
* For example, if they're going to run a script automatically once a week and the simple version takes ten minutes to run. I could spend three hours writing new code and the script would now take eight minutes to run. The time savings would take two years to equal out, so they don't care. But I could also take an extra eight hours and the script would take ten seconds to run, so now the time savings equal out in less than a year. They still don't care, because for something that runs only once a week and doesn't need human attention, nobody cares that the computer does it for ten minutes. If they run it every hour or if it's going to need to scale to millions of requests or entries, I would speed it up. Otherwise, they want lowest maintenance costs and time to write it, with execution speed a sacrifice they don't even notice they've made.