Is the bottleneck rendering the events, retrieving them from relays or processing and prioritizing them?

Reply to this note

Please Login to reply.

Discussion

Rendering heavy messages (lots of tags, big texts, etc) while receiving > 50 events per second seems to be the problem. Not enough memory and threads to do everything in parallel.

I ended up rewriting my note parser in C because of slow perf on large events

What about Rust? 🥺

C is just easier to integrate into xcode builds

It's funny that we have a media engine but not a JSON parser engine in mobile processors.

If there are not enough resources, I would suggest focusing on prioritization and just rendering the rest in a queue with a job pool.

Would an aggregation service for reactions and reply counts, etc help? Could reduce volume anyway.

By volume, reactions are typically highest.

No relays do it yet, however it could make sense to start returning metadata like my REST endpoint.

https://api.nostrgraph.net/beta/events/note1xsttzh4y38nwjc0945qg0t0r2rdna3zakg77pann8xevcjuv306s3qnvh6.json?pretty=true

Rust would def be great for this since it’s already integrated into the Android operating system.

https://security.googleblog.com/2021/04/rust-in-android-platform.html?m=1

Did not know that