Programming Efficiency
摘要
We humans are creatures of perception and reaction times measured in milliseconds. Our modern computers execute instructions in billionths of a second. If a calculation taking millions of instructions completes in a millisecond, it still seems instantaneous to us. But if we have to run that calculation against the million records in our recordset—and it runs in linear time—then it takes \(\sim \)17 minutes to run to completion. When processing even moderately sized datasets, programming efficiency matters. In this chapter, we will consider the time complexities of algorithms, and we will profile our code to compare the runtimes of functionally equivalent programs on our hardware.