Wouldn't the deserialization happen before the code could read the value? Or do some languages steam data into a deserialization method somehow?
Discussion
If you want speed, you deserialise the stream coming from the socket.
Most languages probably do the whole thing first and then do sanity checks.
