ynniv on Nostr: gzip saves space over the wire, but you still have to parse all the bytes. There are ...
gzip saves space over the wire, but you still have to parse all the bytes. There are ways to reduce this (
https://github.com/WebReflection/json.hpack/wiki) as well as organize your schema to be stream-parseable, but it will never be as fast as a binary format. The thing is, HTTP already supports "Accept" and "Content-Type", and there's no reason relays and clients couldn't negotiate a different serialization format.
Published at
2024-10-07 15:25:42Event JSON
{
"id": "d7b9b8ffd84f3ba21993246c603cb576f4ac5ae096b4cf1cc6d761c218b86712",
"pubkey": "576d23dc3db2056d208849462fee358cf9f0f3310a2c63cb6c267a4b9f5848f9",
"created_at": 1728314742,
"kind": 1,
"tags": [
[
"q",
"982bf7716bdf983fa0fb974931aaf4a6c8fe69ac11848ff8bd675b2c1a149fa2"
],
[
"e",
"982bf7716bdf983fa0fb974931aaf4a6c8fe69ac11848ff8bd675b2c1a149fa2",
"",
"reply",
"4523be58d395b1b196a9b8c82b038b6895cb02b683d0c253a955068dba1facd0"
]
],
"content": "gzip saves space over the wire, but you still have to parse all the bytes. There are ways to reduce this (https://github.com/WebReflection/json.hpack/wiki) as well as organize your schema to be stream-parseable, but it will never be as fast as a binary format. The thing is, HTTP already supports \"Accept\" and \"Content-Type\", and there's no reason relays and clients couldn't negotiate a different serialization format.",
"sig": "75d6b805fc5674538cfb67a9ac44963ef47c705edcf8cd0becc81a9b7009c2e3a641f9baa748d579a600c4141e1dc337c279c641da2d172f847d63820041ab70"
}