What Inces pointed out was my guess too. I bet it's the number of projectiles being instanced that is lagging the game. You should try removing any movement logic from the bullets, and try to shoot to see if it still lags. If the game lags when you shoot without moving the bullets, the number of instances are lagging the game. If it doesn't lag, then the sin function is lagging the game.
If the number of instances is the source of the lag, I suggest pre-instancing your bullets, so that they already exist (invisible with disabled collision boxes) when you shoot them, so you just have to make them visible and activate the collision detection instead of adding a new bullet to the scene tree each time