In computing, efficiencyEfficiency concerns the performance of required tasks within the constraints of limited resources. Real-time computing has specific timing constraints, as we have seen. Meeting these timing constraints is easier when the number of tasks and each task's duration—called run timeRun timeReal-time tasks!run timeEfficiency!run time—are minimized. There are many ways to minimize run time. The most direct way is to simply use faster computer hardware. Of course, this comes at an economic cost and is limited by the state of the art. Other methods of reducing run time are those of efficiency.
Another aspect of computing efficiency is in the use of memoryEfficiency!memory. Memory efficiency depends on the nature of the computing process. Often, different algorithms for computing the same task differ widely in the amount of memory used. In all computing, memory is finite, so its efficient use is always of importance.
In this chapter, we examine methods of improving efficiency, with special attention to algorithmicEfficiency!algorithmic and programmatic efficiencyEfficiency!programmatic. The latter is, of course, tightly coupled to programming language. Furthering our exploration of the C programming language, we describe certain fundamental techniques for improving efficiency. These will be applied in Lab Exercise 3 to midlevel user interface (UI) functions for character input/output (I/O).