It seems that when you fire some (not all) homing weapons while far from a worm boss, this causes the game to lag incredibly. I noticed it in the Devourer of Gods fight. I can reliably get this to happen by wiring two teleporters about 2000 blocks apart, moving from one to the other immediately before the boss charges at you, and using the homing weapon after having warped 2000 blocks away from the Devourer's position.
Some weapons I tried which caused lag: Ark of the Elements, Galaxia, Ark of the Cosmos, Terratomere, Alluvion with vanquisher arrows.
Modded weapons such as the Conclave Crossfire with either vanilla chlorophyte bullets or Calamity's terra bullets/verium bullets cause barely any lag, so not all homing stuff causes lag. The pumpkin projectiles from the Horseman's Blade don't seem to cause lag, and neither does the Nebula Arcanum nor the Razorblade Typhoon, even though they are both homing.
When fighting Astrum Deus or the vanilla Destroyer, the game can lag when using the same weapons too. It's just most problematic in the Devourer of Gods fight.