Quick answer: Godot 4 multiplayer state deserialization taking 100ms+ on large game states? var_to_bytes is slow; use a custom binary format.

Game-state sync: server sends 200KB; client deserializes; 150ms frame freeze.

Custom binary format

Hand-roll struct-aligned binary. 10-50x faster than var_to_bytes.

Or chunked deserialize

Per-frame chunks; spread cost.

Profile per-call

var_to_bytes cost visible. Hotspot diagnosed.

“Variant marshalling is generic; slow. Custom is fast; specific.”

If your multiplayer has large state, the custom binary is mandatory. The generic path is too slow.

Related reading