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.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Programming Efficiency

  • James R. Derry

摘要

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.