Quick answer: Godot 4 C# Connect callback running too slow on high-frequency signals (e.g., physics ticks)? Marshaling overhead per event - batch events on the C# side or move to GDScript.

Connect to physics_process; CPU profiler shows 30% in marshalling per-frame.

Batch signal payloads

Sender accumulates events; emits one bulk signal per N frames. Marshaling amortized.

Or use a direct call

For hot paths, call the C# function directly from GDScript via interop. Skip the signal layer.

Profile per-signal

Per-signal callback cost visible in profiler. Outliers are candidates for batching.

“Cross-language signals have overhead. Hot signals pay disproportionately.”

For physics-rate signals, stay in one language. Cross-language only at controller boundaries.

Related reading