Optimization: Basics

CS 301 Lecture, Dr. Lawlor, 2005/10/28

Often our programs don't run fast enough, and we'd want them to run faster.

Examples of programs you'd want to run fast:
If it only happens once, as long as it's within reason (under a second), it doesn't matter how fast it is:

Why is my program slow?

The only trick to optimization is figuring out why the program is running slowly, and then speeding it up.

To answer the "why" question, you can use:
Good timers are built into NetRun, and accessible with the "Time" checkbox (which times the foo routine), and "print_time" (which times a subroutine of your choice).