GDScript is fast enough for most of a typical indie game. Menus, UI logic, game state, input handling and the bulk of gameplay scripting rarely show up as a problem. But every so often a project hits a wall: a pathfinding loop, a procedural generation pass or a few hundred agents updating every frame, and the frame time starts creeping past your 16.6 ms budget.
The tempting response is "rewrite it in C#" or "move it to C++." Sometimes that's right. Often it isn't, and the extra build complexity costs a small team more than it saves. Here's the checklist we'd suggest for indie teams working in Godot 4 before porting anything.
1. Measure on your slowest target, not your dev machine
Profile on the lowest-spec hardware you plan to support, whether that's a Steam Deck, an older laptop with integrated graphics or a mid-range phone. A loop that costs 1 ms on a desktop workstation can cost several times that on a handheld. Write down the frame budget you're aiming for before you start, so you know when you're done.
2. Use the built-in profiler first
Run the game from the editor, open the Debugger panel and start the Profiler. It breaks frame time down by function, so you can see which scripts and methods are actually expensive. The Monitors tab is useful alongside it for object counts, draw calls and physics time, which helps you rule out rendering or physics as the real bottleneck.
Capture a few seconds of the worst-case scene (the biggest wave, the busiest town, the largest generated map) rather than an idle menu.
3. Add manual timing around suspect code
The profiler tells you where to look; manual timing tells you whether a change helped. A simple pattern:
var start := Time.get_ticks_usec() _update_agents(delta) var elapsed := Time.get_ticks_usec() - start if elapsed > 2000: print("agents update took %d us" % elapsed) Keep these around in a debug build and log the worst values, not just the average. Spikes are what players notice.
4. Fix the algorithm before the language
Most GDScript hot paths we see come down to a few common patterns:
- Searching an array every frame where a Dictionary lookup would do
- Calling
get_node()or string-based lookups inside loops instead of caching references in_ready() - Running a full update on every agent every frame instead of spreading work across frames
- Creating and freeing many short-lived objects instead of pooling them
A better data structure or update schedule usually beats a language change by a wide margin, and it helps whatever language you end up in.
5. Add static types to hot code
In Godot 4, typed GDScript (var speed: float, func step(delta: float) -> void, typed arrays like Array[Vector2]) lets the engine use optimized code paths, and it catches mistakes earlier. It's a low-risk change you can make to just the hot functions. Re-profile afterwards; don't assume.
6. Check whether an engine feature already does the work
Before writing your own solver, check the built-in options: NavigationServer for pathfinding and avoidance, AStar2D/AStarGrid2D for grid paths, PhysicsServer queries, or MultiMeshInstance for drawing large numbers of identical objects. These run in engine code and are often faster than anything you'd write by hand in any language.
7. When C# is worth it
C# can make sense when the hot code is heavy on maths and data processing, your team already knows .NET well, and your target platforms support Godot's .NET build. Check platform support for your exact Godot version before committing, and remember you're adding a second toolchain, a different export template and more for every new team member to set up. Moving one isolated system (a simulation step, a generator) is much easier to justify than converting the whole project.
8. When GDExtension is worth it
GDExtension (typically C++ with godot-cpp) is the option for code that needs native speed or a native library, such as a custom physics routine or a third-party SDK. The cost is real: compiled binaries per platform, a CI step to build them, and debugging across two languages. Keep the native surface small, with a clear API that GDScript calls into, and leave everything else in GDScript.
Wrapping up
The order matters: measure on target hardware, use the profiler, fix the algorithm, add types, lean on engine servers, and only then consider C# or GDExtension for the few systems that still don't fit the budget. Planning performance work early also makes scheduling easier; we wrote about scheduling decisions for a console release aimed at the US holiday season.
If you're planning a project in Godot and want an experienced team, Juego Studios offers Godot game development services for indie and mid-size studios.
