Expose a zero allocation API to Godot C# bindings

### Describe the project you are working on Godot C# bindings ### Describe the problem or limitation you are having in your project For the past weeks, I've been discussing with several Unity users intending to move to Godot C# regarding dealing with the C# garbage collector. The most common complaint I hear from users is that, in Unity, allocations can trigger unexpected GC spikes into the game. In Godot, we target to make all of the high performance APIs (those that intended to be called every frame) not allocate any memory, so theoretically the GC should not be a problem. Additionally, Godot starting from 4.0, uses the Microsoft CoreCLR version of .net, which also supposedly has a better garbage collector than Unity. But in all, after several discussions with Unity users, neither is enough reassurance for them, and they would really feel safer if Godot exposed a zero allocation API. ### Describe the feature / enhancement and how it helps to overcome the problem or limitation The idea of this proposal is that Godot exposes zero allocation versions of many functions in the C# API, that users can use if they desire. Technically, this could be done from the binding generator itself, without breaking compatibility, and without doing any modification to Godot itself. ### Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams **WARNING** I am not familiar with C#, so take this as pseudocode. Imagine you have two functions exposed as to C#: ```C# void MyClass.SetArray( Vector2[] array); Vector2[] MyClass.GetArray(); ``` This works and is pretty and intuitive. However, it has two problems: * GC is allocated on return * Memory is copied to Godot native formats every time there is a call. The idea is to add NoAlloc versions, which can be generated directly by the binder automatically when required: ```C# void MyClass.SetArrayNoAlloc( Godot.Collections.PackedVector2Array array); void MyCl

GitHubToolAISource
0Sign in to voteCopy link

FL score

84

out of 100

Verdict

BUILD

medium confidence

Competition

0

competitors found, emerging market

Trend

No signal yet

A high-impact technical solution for Godot C# developers struggling with GC spikes, but monetization and solo buildability are significant challenges.

The pain

C# game developers using Godot face unexpected garbage collection spikes due to memory allocations in existing bindings and marshalling overhead, leading to noticeable frame drops and hindering performance-critical games.

The gap

While Godot's CoreCLR aims for better GC, users lack reassurance and direct control over allocations. The existing C# bindings inherently cause allocations, and there's no systematic 'zero-allocation' API offered to directly address this critical performance bottleneck for C# users.

Build angle

Generate zero-allocation versions of Godot C# API functions via the binding generator, allowing developers to explicitly choose performance-optimized calls (e.g., MyClass.GetArrayNoAlloc(PackedVector2Array array)).

Strengths

  • Addresses a deeply felt, critical performance problem for a specific user segment (Godot C# game developers).
  • Clear, measurable value proposition (no GC spikes, smoother performance).
  • Strong demand signals from community discussions and proposals.
  • Solution is technically feasible within the binding generator itself.
  • Market for high-performance game development is growing.

Risks

  • High technical complexity requiring deep knowledge of Godot internals and C# binding generation.
  • Monetization as a standalone product is difficult; it's perceived as a core engine feature.
  • Risk of Godot officially implementing this proposal, rendering a third-party product redundant.
  • Limited compound value for solo builders outside of direct engine contribution.
  • Audience, while specific, is niche within the broader game development ecosystem.

Next steps

  1. Engage directly with the Godot C# community and core developers on the existing GitHub proposal to understand their plans and gauge reception for a community-driven or commercial solution.
  2. Build a proof-of-concept for a few critical API functions to demonstrate the performance benefits of zero-allocation bindings.
  3. Explore potential monetization models: Could it be a premium plugin on the Godot Asset Store? A specialized performance library? Or is it best contributed directly to Godot as an open-source project?
  4. Interview target users (Unity C# developers migrating to Godot) to understand if they would pay for this solution if it were available outside of the core engine.

Questions about this idea?

FlyBot reads the scoring and gives you a second opinion on “Expose a zero allocation API to Godot C# bindings”.

Open FlyBot