Was Our Objective Met?
This applet above allows you to select from the various line drawing algorithms discussed. You
can draw lines using the selected algorithm by clicking and dragging with the first mouse button.
You can also time the algorithms by clicking on Benchmark. In order to get more accurate
timings the pattern is drawn five times (without clearing), and the final result is displayed.
|
To the left is a benchmarking applet
Modern compilers will often find these sorts of optimizations
Dilemma:
Is it better to retain readable code, and depend a compiler to do the
optimization implicitly, or code the optimization explicitly with some loss in readability?
|