jb55 @jb55 - 2y
one of the slowest parts of receiving lots of events on mobile is actually json decoding. I wonder if it’s time to create an optimized binary transport for nostr notes. Could be a simple TLV format.
b3e43 - 2y
グッドモーニング☀️
0e460 - 2y
That’s what I call an idea 👍
ohaiou
f4db5 - 2y
GM Will 🌞💜🧡🤙
5abcd - 2y
I have no idea what you are saying but I know it will be awesome.
496d3 - 2y
That is correct, will. Now tell the people what the audiophiles prize. 📎
nostrnaut @nostrnaut - 2y
me reading this note:
b2dd4 - 2y
Using the inbuilt Apple JSON support? Maybe we can try swap out to a faster external library? The other major issue I see is websockets have no congestion management - it’s event by event, and a large event blocks all the smaller ones behind it.
Jack Chakany @Jack - 2y
Definitely
This? “IkigaJSON is a really fast JSON parser. It performed ~4x faster than macOS/iOS Foundation in our tests when decoding a type from JSON.” https://github.com/orlandos-nl/IkigaJSON
0xtr @0xtr - 2y
I don’t see why not 🤷♂️
i tried a branch where I built my own custom json decoder, but you still need to walk every byte in the string and unescape things. json decoding is not trivial, where a TLV format would be as simple as copying bytes directly.
8eee8 - 2y
Yes. And there is more of what should be done: https://damus.io/note12044688xrg67tnc2lkv5whwrvycy0y2rsrg6lgd8s8ses2pr57nsfv85x5
gek @gek - 2y
I don’t think I understand what this man means but it talks about replacing json decoding with something else… if it’s j something it needs replacing, right? Thant’s how it works?
I need to automatically convert these links to note refs…. nostr:note12044688xrg67tnc2lkv5whwrvycy0y2rsrg6lgd8s8ses2pr57nsfv85x5
ohayo!
Duck Nebuchadnezzar @duck - 2y
Would this mean that relays would need to support both formats? (falling back to json if the client doesn't support it)
Nope, relays could advertise that they support it or not. Would be completely optional.
1e9d8 - 2y
But then you specifically request data in this firmat from the relay, so that you need no detection on client side, right?
It would be advertised in the relay metadata if it’s supported or not.
I just realized this isn’t true, since the json encoded string is signed you would be forced to decode json strings regardless. Damn this probably isn’t worth it then.
Nm I’m dumb the decoded string is signed . I should have coffee before I start thinking of new data formats.
7bdef - 2y
oof
deba2 - 2y
Do you actually need to check the signature in this situation?
Right now relays are one of around five or so implementations. The issue is at some point when we end up with many more satellite (smaller) relays, malicious relays (or even software bugs) will start to appear. Maybe trusted relays could have their events skip validation - however, at any moment validation could become really important to enforce client side.
You could run the validation async on the phone (e.g. first get data and then on demand verify signatures as the user scrolls through feed and maybe show a little checkmark when the verified and show red warning when not)