If you are playing the web browser version, the lag spikes can be due to a set of code trying to run for the first time (enemy fireball, throwing a slime, loading the room for the 1st time).