-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pValue #208
Conversation
Very good idea! I'll review properly tomorrow, but the idea is 💯 |
What about also pContent? It should be quite common to go into msg.value.content |
It really depends on how often it is used. pValue is used in both timestamp, sequence and in most user specified queries. If you did a query for only author, then pContent would be wasted. pContent might make more sense in level indexes inside db2. I tried added it, but I don't have enough plugins to see any difference. In manyverse I have a feeling you are using a lot so might make more sense. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exciting to squeeze more performance out of this!
I guess this should be 7.0? |
I think there is no breaking change here. Correct me if I'm wrong. The new argument is at the end, so any consumer of jitdb can be free to not use that argument and just recalculate pValue. Should be a new minor version. |
Right, javascript will just throw away any extra arguments :) |
Benchmark results
|
Benchmark results
|
I was wondering if we could do better on initial sync. #206 started out as that. That PR changed 1 initial jitdb query from around 17s to 15 something. Then I started wondering if we could do more and found that doing these extracting values (seq, timestamp, sequence) was significant. Meaning not only what we are looking for (opData.seek), but also the base values. Then I started playing around and found that actually finding the position of value inside the buffer is quite significant, so I refactored the code to get that once and pass that in. Note seekFromDesc allows a start (defaults to 0) and because of that we need 3 parameters to the seek function. I changed the seekers in ssb-db2 and now things are down to around 11s. This is on my laptop when it is not plugged in. Plugged in we are down to 7s :-)
This PR is against #206, I'll change that once we know about that PR.