Maybe this idea has already been known, but I wanted to share it.
In oblivion a video game from long ago, a editor called TES construction set was released for it. It allowed editing the game scripts of the game Oblivion.
I noticed that the quest scripts where donig lots of cpu cycles, lots of them. I then came up with a way to reduce those cycles increasing my FPS all the way into 60.
Godot allows similar way of reducing cpu cycles. In godot it's called delta.
taking delta, if it's not time yet, then don't do anything.
For example: The TES construction set had scripts that checked the players position, about 3 or more position checks per script. that's lots of cpu cycles when you count how many times it's called per second. I was able to reduce those cpu cycles by not checking the position for the quests until it was time to check. So, about 0.1 seconds or more. Plenty of accuracy on the timing to catch the players position.
Other scripts in the TES construction set would check to see if the player had started a quest, or if the player had been in the INN room and if it was time to clean the INN room. By putting this timing reduction in the TES construction set I was able to get more than 60FPS. That was on an old Pentium D running at 2.8ghz.
I believe I was able to elimate millions of cpu cycles.
func _proc(delta):
timecheck+=delta
if(timecheck<0.1):
return
timecheck=0
...cpu cycles to reduce...
pass