mutatrum on Nostr: Nostr performance pro tip: put the `id` field first in an event. This enables clients ...
Nostr performance pro tip: put the `id` field first in an event.
This enables clients and relays to abort deserialisation if they've already seen the event.
After that the `created_at` and `kind`, as that can also eliminate unnecessary deserialisation early on.
Published at
2023-09-16 14:43:38Event JSON
{
"id": "3e03777ebdd8eb845e55a3f6a52da2b2f267280322d90dc92e5ce3a5cde2efa0",
"pubkey": "bdbe1bdbc9b25a8d89d8fdaf0be1a0dcd837bac9691f597892903a5fdd86e27f",
"created_at": 1694868218,
"kind": 1,
"tags": [],
"content": "Nostr performance pro tip: put the `id` field first in an event.\n\nThis enables clients and relays to abort deserialisation if they've already seen the event.\n\nAfter that the `created_at` and `kind`, as that can also eliminate unnecessary deserialisation early on.",
"sig": "31ae25ad7780e095b879f2b3701228a145eee09a4e673c72fa6873b5519c3a6853dbb239b20a1521b43cc6c9888ff1b24604a04f7d59367dcbd3206442d2fed4"
}