Closed arj03 closed 3 years ago
@staltz notes for tomorrow
Data points:
I consider contacts quite fundamental to SSB which is why I'm thinking of putting it in core. The overhead if quite minimal. I was looking over ssb-friends and if you rip out the db part, it is mostly convenience methods. So could live in its module and just use db2 as the storage.
Also by doing it this way we don't need to keep very much in memory which I think existing friends does. This should be especially good for startup time.
ssb-friends has two layered reduces: one reduce for "is A following B?" over all contact messages that A created, and another reduce that depends on the previous one: "at what hops distance is C from A?"
hops(1)
I thought with Dijkstra that it has a graph and the you can ask it about any start point with that I have only seen one call to createLayer? Do you mean there are two reduces inside layered graph?
We probably want to start with dynamic-dijkstra and just remove the layered graph stuff. As always things like this makes me uneasy.
It turns out my test script for jitdb had quite a bit of overhead, so now its between 40ms for small profiles (staltz phone) to 100ms for mix. In comparison base index is 15ms and 58ms. Also my earlier observation about adding select style queries instead of just returning the whole message still holds. It is not faster.
This task turned into a friends PR. Currently the index format is too slow, but I'm quite sure it will work with dictionary compression. Will try that today.
Now that the db2 compatibility is merged into ssb-friends I'll close this