No, it is not necessary to use a crystal.
But your DEFINE OSC must match your actual oscillator frequency.

If you have specified the internal oscillator in your configs, then the default is 4Mhz, not 20Mhz.
And your program is running at 1/5th the speed it is supposed to.