I just spent two days re-architecturing Amethyst for performance to figure out it's worse... 🫤
Gotta figure out a different way to load thousands of events quickly.
I just spent two days re-architecturing Amethyst for performance to figure out it's worse... 🫤
Gotta figure out a different way to load thousands of events quickly.
🙏
Damm, I know you can crack that out!
🫵💪💪💪💪
Usually the answer is not loading them at all, or if you do, not building objects for everything. Usually splitting from array of structs into struct of arrays also helps, as you can vectorize better (not sure if NEON is available for cellphones though) and have better cache locality.
Is the bottleneck rendering the events, retrieving them from relays or processing and prioritizing them?
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
🤔 https://bignerdranch.com/blog/building-an-ios-app-in-rust-part-1-getting-started-with-rust/
I’ll try to check it out.
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.
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
💜✨
Appreciate with it 🫡
I really didn't see the code of Amethyst, but something that I learned.
Searching and sorting of events can become very very fast for json objects (complexity is O(1)) which are indexed with a unique key that can be hand made that Amethyst makes for each incoming event. ( Added for internal processing for Amethyst).
I've tried out all the other Android nostr clients.
I keep using Amathyst.
🫂💜
Thank you for everything you do!
Great job!!!! A Thousand Thx
Nip65 ?
💪🧡💜
Your post is making waves.
Added to the https://member.cash/hot feed
Might be worth pushing the branch (if you haven't already) to see if anyone has useful insight. I wouldn't mind giving it a once over.
That’s why you get zapped