greenart7c3 on Nostr: Yea, essentially the main issue with performance on citrine was that I was not using ...
Yea, essentially the main issue with performance on citrine was that I was not using suspend functions in the room dao operations, it would lock the database until a query completes and it would not cancel coroutines when needed.
I haven't done any benchmarks but using lmdb from rust-nostr seens faster, don't have the 100-200 memory limit of android apps but I loose everything else like flows, group events by kind etc
Haven't tried nostrdb yet
Using sqlite I still have to test if I can improve some index and I always have to remember of the memory limitations, if anything tries to get all events from a big database I have a oom and the app crashes
Published at
2025-01-03 10:00:05Event JSON
{
"id": "91900cf37a4dfb5af62933d368a8bd332834affb13b427bcb19f393e321d92da",
"pubkey": "7579076d9aff0a4cfdefa7e2045f2486c7e5d8bc63bfc6b45397233e1bbfcb19",
"created_at": 1735898405,
"kind": 1,
"tags": [
[
"e",
"ecc52b94102eb575b5ed4f2847e2158440612b588f3d6ba58c0bd05fd39dab9d",
"",
"root"
],
[
"e",
"84e576cb38b16f43bff17218661b26001b5e928412eefbfa4129b328cb56401b"
],
[
"e",
"1b81b9f299698925d315642be174f146f1135632c740caabd1e15e0920b82d2e",
"",
"reply"
],
[
"p",
"846ebf79a0a8813274ec9727490621ad423f16a3e474d7fd66e6a98bfe4e39a4"
],
[
"p",
"fd208ee8c8f283780a9552896e4823cc9dc6bfd442063889577106940fd927c1"
],
[
"p",
"460c25e682fda7832b52d1f22d3d22b3176d972f60dcdc3212ed8c92ef85065c"
]
],
"content": "Yea, essentially the main issue with performance on citrine was that I was not using suspend functions in the room dao operations, it would lock the database until a query completes and it would not cancel coroutines when needed. \nI haven't done any benchmarks but using lmdb from rust-nostr seens faster, don't have the 100-200 memory limit of android apps but I loose everything else like flows, group events by kind etc\nHaven't tried nostrdb yet\nUsing sqlite I still have to test if I can improve some index and I always have to remember of the memory limitations, if anything tries to get all events from a big database I have a oom and the app crashes",
"sig": "6060669de71c1af14a35b05b3e6455089bd529e1c5fb1bb667aa662d0dbc4f4b7f532d3341d3a49fdd4d2d63f77cafcc96ecd300588af3922ae004b30ccd539f"
}