Pikalek answer is correct. I'll expand a bit about the performance and the translation process.
I want to point out that C# will give you more optimization avenues than GDScript, because C# has typed dictionaries, supports passing by reference,defining custom structs, etc.
C# has other perks not available in GDScript, for example interfaces.
Be aware that C# - as GDScript - run on the CPU, so the GPU should remain the same.
Furthermore, I want to point out that this is not an all or nothing conversion, as Godot support having both GDScript and C# on the same project.
My recommendation is to have GDScript call into C#, this is because the integration of GDScript with Godot is better (having syntax for easy node access, and for exporting variables to the inspector).
One gotcha you will stumble upon the interaction between C# and GDScript is that they can't consume each other async methods. However, GDScript
yield can work with a method that returns objects that emit signals, and you can
await signals on C# with
ToSignal. Thus, you might want to refactor any asynchronous operations in the boundary between C# and GDScript to use signals for communication.
Because of this, you can translate your project from GDScript to C# by parts. However you need to choose carefully the boundary for your translation.
Another thing to keep in mind is that C# is an static typed language.
Even if you decide to use
dynamic in C#, GDScript duck typing is more convenient for dynamically typed code (usually if you rely on duck typing in GDScript, you would want to define interfaces in C#).
Thus you might find helpful to specify the types of as much of the GDScript code as possible before attempting to translate to C#. At least when C# and GDScript interact, you need the methods to have their return and parameters types specified.
The Godot editor will help you identify which lines are not fully typed... Pay attention to the color of the line numbers. If the color is pale, the line is not fully typed.
By the way, you don't have to specify all types explicitly. As in GDScript you can use implicit typing, by initializing variables with
:= instead of
= (this is similar to using
var in C# or
auto in C++).
Anyway, as you would know, you cannot have everything fully typed in GDScript (e.g. GDScript does not have typed dictionaries, as mentioned earlier), but as long as you can tell the types even when the code is not fully typed, you should be able to translate to C#.
I'll close by saying that even though C# is fully supported in Godot, since C# integration with the Godot editor is inferior, you will want to move to an external editor for C#, which might give you proper IntelliSense, refactoring options, and so on.