Pro tip: I found out loops run way faster than I assumed, and now I actually test my guesses
I always figured a loop over 10,000 items would crawl on my laptop, so I kept writing these super careful single-pass versions of everything and patting myself on the back. Then I ran a dumb little benchmark in Python on my old ThinkPad while waiting for a bus in Sacramento, comparing a for loop against a list comprehension over a million numbers, and the list comp came out around 40 percent faster. That number floored me because I had been blaming my loop logic for slowness when a lot of it was just picking the slower way to build a list. I started timing raw slices of code instead of guessing, first with time.time() and then with timeit once I read that time.time() can be noisy. Some of my hunches held up, but plenty of them were straight up wrong, like a nested loop I swore was the bottleneck that turned out to be a file read I was doing inside it. I am not saying ignore speed, I am saying my gut is a bad stopwatch. If you have been coding for a few months, what is a benchmark result that surprised you and made you rewrite something you were sure about?