next next up down toc toc mail

12.1.  Two major kinds of problems

1. CPU time, if speed is what we're interested in, is affected by very many factors, many of which are not related to the algorithm itself:

--   which computer
--   how heavily is it loaded
--   which programming language
--   which compiler
--   hidden factors can swamp the ones you're trying to measure:
     -- array-bounds checking
     -- relative speeds: array indexing, record access and pointer following,
     -- overhead for procedure calls
     -- I/O

2.Which test data? It is true that `constant time' algorithms, by definition, take the same amount of time on all inputs. But most algorithms are not constant time so we cannot measure efficiency as a single number; it must be expressed as a function of the input.

back next up down toc toc mail

Created by unroff & hp-tools. © by Hans-Peter Bischof. All Rights Reserved (1998).

Last modified: 27/July/98 (12:14)