Is glaze good for network message serialization? #735
-
Hello, I saw glaze supports BVE, should I use that for message serialization? Is it faster than JSON (glaze)? Thanks for your help. Best regards |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Yes, Glaze is used by many for networking (including the company I work for). Sending JSON messages keeps things human readable and easy for other programs, languages, and clients to interface with. BEVE is a good deal faster than JSON (2X to 3X) and the messages will be smaller. But, BEVE is new and does not have wide support like JSON, so I would only recommend it if you are handling both the server and the client. FYI, Glaze will be releasing a new RPC interface for JSON and BEVE soon. But, Glaze also supports JSON RPC 2.0 (see documentation). |
Beta Was this translation helpful? Give feedback.
-
After switching from read_json to read_binary this "case" dont work anymore, any idea to tell this is a null object or smth like that? struct DownloadLogs
{
NETWORK_META_DATA(DownloadLogs)
struct glaze {
using T = DownloadLogs;
static constexpr auto value = glz::object();
};
};
DownloadLogs value ;
glz::read_binary(value, ...); // fails here with string buffer |
Beta Was this translation helpful? Give feedback.
Yes, Glaze is used by many for networking (including the company I work for). Sending JSON messages keeps things human readable and easy for other programs, languages, and clients to interface with. BEVE is a good deal faster than JSON (2X to 3X) and the messages will be smaller. But, BEVE is new and does not have wide support like JSON, so I would only recommend it if you are handling both the server and the client.
FYI, Glaze will be releasing a new RPC interface for JSON and BEVE soon. But, Glaze also supports JSON RPC 2.0 (see documentation).