Good Programming Practice – Coding Efficiency
Introduction |
---|
Efficiency, as it applies to programming, means obtaining the correct results while minimizing the need for human and computer resources. We have broken the various aspects of programming efficiency into four major components and will discuss each below.
|
CPU Time |
---|
Compiling and executing programs take up time and space. The required time the CPU spends to perform the operations that are assigned in the statements determine the complexity of the program. In order to make the program efficient and to reduce CPU time, we should
|
Data Storage |
---|
Data storage is primarily concerned with temporary datasets generated during program execution which can become very large and slow down processing. Here are some ways to reduce the amount of temporary data storage required by a program:
|
I/O Time |
---|
I/O time is the time the computer spends on data input and output (reading and writing data). Input refers to moving data from disk space into memory for work. Output refers to moving the results out of memory to disk space or a display device such as a terminal or a printer. To save I/O time, the following tips can be used:
|
Programming Time |
---|
|
References |
---|
SAS Programming Efficiencies: http://www.ssc.wisc.edu/sscc/pubs/4-3.pdf Gilsen, Bruce. SAS ® PROGRAM EFFICIENCY FOR BEGINNERS: http://www.ats.ucla.edu/stat/sas/library/nesug00/bt3005.pdf Lafler, Kirk Paul. Efficient SAS® Programming Techniques: http://www2.sas.com/proceedings/sugi25/25/hands/25p146.pdf Langston, Rick. Efficiency Considerations Using the SAS® System: http://www2.sas.com/proceedings/sugi30/002-30.pdf Carpenter, Arthur L. Getting More For Less: A Few SAS® Programming Efficiency Issues: http://www.caloxy.com/papers/35-CC199.PDF SAS Institute Inc. SAS® Programming Tips: A Guide to Efficient SAS Processing. 155pp. 1990. Text is available under the Creative Commons Attribution-ShareAlike License ; additional terms may apply. See Terms of use for details. |