mleku on Nostr: i just learned about this tho from this: and i can't help myself but implement it lol ...
i just learned about this tho
https://github.com/deneonet/bencfrom this:
https://alecthomas.github.io/go_serialization_benchmarks/and i can't help myself but implement it lol
faster than flatbuffers... faster than capn proto
the benefits of those flat/decode on demand style of codecs are zero when you actually need the whole data and taking advantage of it, requires refactoring an entire search matching library (filters in nostr)
so, i'm just gonna go with this
its syntax is like Go except also like Protobuf
it has some scheme about versioning and shit but honestly for this use case, like, such as replacing the entire nostr encoding, with the envelopes, filters and events... this would be the hands down best option because the data usually needs to be matched on several criteria in the "extra filter" used in the database indexing scheme that fiatjaf devised, so the extra logic to decode them before running the match when half the time half the fields need to be decoded, and most of the fields except for two are already just raw bytes in my data structure format...
this is it, no more fucking around, the end, faster than this is impossiburu
Published at
2024-11-16 11:57:12Event JSON
{
"id": "614fb55771c5bb339b23c3afd3930c97666b0bb89dbd0a948a78f2d5f8a6e02f",
"pubkey": "4c800257a588a82849d049817c2bdaad984b25a45ad9f6dad66e47d3b47e3b2f",
"created_at": 1731758232,
"kind": 1,
"tags": [
[
"e",
"fb804add080068b4b6695d2b1d3acd31bf2e113998f92b6922500ff295ffb2e6",
"wss://nostr.land/",
"root"
],
[
"e",
"fb68ba4bb6c94de2af8813db9ffb66f8b97db884a537484d91b505191daf8ba4",
"wss://nostr.land/",
"reply"
],
[
"p",
"8633073b8567da97ad119fedd9716154aa283234cbb7d28d5131daa077d1cf7a",
"",
"mention"
],
[
"client",
"noStrudel",
"31990:266815e0c9210dfa324c6cba3573b14bee49da4209a9456f9484e5106cd408a5:1686066542546"
]
],
"content": "i just learned about this tho\n\nhttps://github.com/deneonet/benc\n\nfrom this:\n\nhttps://alecthomas.github.io/go_serialization_benchmarks/\n\nand i can't help myself but implement it lol\n\nfaster than flatbuffers... faster than capn proto\n\nthe benefits of those flat/decode on demand style of codecs are zero when you actually need the whole data and taking advantage of it, requires refactoring an entire search matching library (filters in nostr)\n\nso, i'm just gonna go with this\n\nits syntax is like Go except also like Protobuf\n\nit has some scheme about versioning and shit but honestly for this use case, like, such as replacing the entire nostr encoding, with the envelopes, filters and events... this would be the hands down best option because the data usually needs to be matched on several criteria in the \"extra filter\" used in the database indexing scheme that fiatjaf devised, so the extra logic to decode them before running the match when half the time half the fields need to be decoded, and most of the fields except for two are already just raw bytes in my data structure format...\n\nthis is it, no more fucking around, the end, faster than this is impossiburu",
"sig": "930c2f0eae0bbef256dcebdeebfdbc901a3f20321e4013991ae62d920c3fc6f21b4e2dd7ac948bf55f06d38010b45e78483ca8e4219d5f2033ab23bef5d32238"
}