I have a relatively slow loop in my program, lots of calculations.

The loop takes about 5 seconds when the program first starts, but only takes about 3 seconds
when executed later in the program.

Is the code being moved into cache memory or something, after it first runs?