Efficiency
Today I learned that print statements cost more than you think. I had a program that needed to perform a calculation...100 million times. I, in my wisdom, had it print what it was doing...100 million times.
When I ran it with print statements, it took over an hour to complete. When I removed the print statements, it took seconds.
It turns out even tiny bits of inefficiency can add up. Who would've guessed?
Previous
Next