ssbc / ssb-friends

Manages the SSB social graph
MIT License
23 stars 6 forks source link

Only decode author if contact message #76

Closed arj03 closed 2 years ago

arj03 commented 2 years ago

I was wondering why indexing was taking so long, so I took my favorite test and added a lot of the plugins used by manyverse. I noticed that adding ssb-friends really makes things a lot slower. From like 24s to 71s. So went looking a bit and this (commit 1) was an easy low-hanging fruit. Shaves off around 2s. Then I realized (commit 2) that the next part does 2 x O(n) and this is probably where the slowness comes from. And yep, with commit 2 the time is down to 28s :-)

arj03 commented 2 years ago

Excellent. I tried all the other db2 plugins (suggest, threads, search2) and didn't find them to be that problematic so hopefully this should have a good speedup on larger databases especially.