In the history of computing, optimum programming, or optimum coding is the practice of arranging a computer program's instructions in memory so as to minimize the time the machine spends waiting for instructions. It is of historical interest mainly due to the design of many early digital computers.
Most early computers used some form of serial memory, primarily
delay-line memory or
magnetic drum
Drum memory was a magnetic data storage device invented by Gustav Tauschek in 1932 in Austria. Drums were widely used in the 1950s and into the 1960s as computer memory.
For many early computers, drum memory formed the main working memory o ...
s. Unlike the
random-access memory
Random-access memory (RAM; ) is a form of computer memory that can be read and changed in any order, typically used to store working data and machine code. A random-access memory device allows data items to be read or written in almost t ...
of modern computers, words in serial memory are made available one at a time; the time required to access a particular word depends on the "distance" between it and the word currently being read. If a given delay line held ''n'' words, the average time to read a word would be ''n''/2 word times. Without optimum coding, such a machine would spend most of its time idly waiting for instructions and data.
To circumvent this problem, many machines, particularly
Alan Turing
Alan Mathison Turing (; 23 June 1912 – 7 June 1954) was an English mathematician, computer scientist, logician, cryptanalyst, philosopher, and theoretical biologist. Turing was highly influential in the development of theoretical c ...
's
ACE and its descendants, included a field specifying the address of the next instruction to be executed in their instruction format. A programmer employing optimum coding would look up the time needed to perform the current instruction, calculate how far the memory system would move in that time, and then place the next instruction for the program at that location. Thus when the current instruction completed and the computer looked for the next one as specified in the instruction, that memory location would just be arriving and would be able to be read in immediately. For example, if a programmer had just coded an
ADD
instruction at address 400, and the
ADD
instruction required 4 word-times to execute, the programmer would set the "next address" field of the instruction to 404, and would place the next instruction there.
In the United States, optimum coding was most commonly employed on the
IBM 650
The IBM 650 Magnetic Drum Data-Processing Machine is an early digital computer produced by IBM in the mid-1950s. It was the first mass produced computer in the world. Almost 2,000 systems were produced, the last in 1962, and it was the firs ...
and the
Bendix G-15
The Bendix G-15 is a computer introduced in 1956 by the Bendix Corporation, Computer Division, Los Angeles, California. It is about and weighs about . The G-15 has a drum memory of 2,160 29-bit words, along with 20 words used for special purpos ...
. Both machines had optimizing assemblers (SOAP for the IBM, POGO for Bendix) that could automate this task.
See also
*
Mel Kaye
The Story of Mel is an archetypical piece of computer programming folklore. Its subject, Melvin Kaye, is an exemplary "Real Programmer" whose subtle techniques fascinate his colleagues.
Story
Ed Nather's ''The Story of Mel'' details the extraord ...
, who authored one particularly clever bit of optimum programming that has entered computer lore, is described in
The Story of Mel.
References
{{Reflist
Software optimization