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 :-)
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.
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 :-)