Closed mahditakrim closed 1 year ago
Is it better to use json decoder instead of unmarshal when reading binary data using 'wsutil.ReadServerBinary(conn)' ? I know decoder is better when reading HTTP requests.
Depends on your goal. Both can reuse memory to achieve zero-alloc (if it's a goal).
Anyway, no big difference in most cases, pick any that looks better for you now.
Thanks.
Is it better to use json decoder instead of unmarshal when reading binary data using 'wsutil.ReadServerBinary(conn)' ? I know decoder is better when reading HTTP requests.