Next | Making Programs Faster | 22 |
Some programs do relatively little computation or I/O but are slow anyway
Consider this simple program:
print sort <>;
Theoretically, the sort runs in O(n log n) time, on average
That means that if the input size doubles, the run time should be a little more than twice as long
From this we might extrapolate that 2048000 items will take about 283 seconds
Actually it took 14,601 seconds
Next | Copyright © 2003 M. J. Dominus |