Skip to content
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

Support passing in pValue #324

Merged
merged 3 commits into from
Apr 4, 2022
Merged

Support passing in pValue #324

merged 3 commits into from
Apr 4, 2022

Conversation

arj03
Copy link
Member

@arj03 arj03 commented Apr 3, 2022

This is what I have used to test ssbc/jitdb#208. So not really ready yet.

Also we can do the same trick here for level indexes :)

@arj03
Copy link
Member Author

arj03 commented Apr 3, 2022

Some numbers:

Only base + keys index & query for 1 author empty indexes

base: 41.1s
no decrypt: 30.2
no decrypt + jitdb pValue: 25.6

Base, keys, ebt, full mentions index & query for 1 author empty indexes

base: 56.3s
no decrypt + jitdb pValue: 37.7

So the more level plugins you have, the better it gets. It might also be a good idea to pass things like pContent to level plugins. Maybe even jitdb.

db.js Outdated Show resolved Hide resolved
indexes/about-self.js Outdated Show resolved Hide resolved
@arj03 arj03 marked this pull request as ready for review April 4, 2022 08:10
@github-actions
Copy link

github-actions bot commented Apr 4, 2022

Benchmark results

Part Duration
add 1000 elements 524ms
add 1000 private box1 elements 1044ms
unbox 1000 private box1 elements first run 119ms
unbox 1000 private box1 elements second run 79ms
add 1000 private box1 elements 1047ms
query 1000 elements first run 31ms
query 1000 elements second run 16ms
add 1000 private box2 elements 574ms
unbox 1000 private box2 elements first run 322ms
unbox 1000 private box2 elements second run 320ms
Migrate (+db1) 10547ms
Migrate (alone) 3232ms
Migrate (+db1 +db2) 6954ms
Migrate (+db2) 5419ms
Migrate continuation (+db2) 815ms
Memory usage without indexes 721.51 MB = 32.24 MB + etc
Initial indexing 544ms
Initial indexing maxCpu=86 3641ms
Initial indexing compat 634ms
Two indexes updating concurrently 795ms
key one initial 41ms
key two 1ms
key one again 2ms
reboot and key one again 40ms
latest root posts 537ms
latest posts 11ms
votes one initial 457ms
votes again 2ms
hasRoot 301ms
hasRoot again 1ms
author one posts 226ms
author two posts 16ms
dedicated author one posts 264ms
dedicated author one posts again 2ms
Maximum memory usage 808.48 MB = 46.82 MB + etc
Indexes folder size 12.76mb

Copy link
Member

@staltz staltz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh silly me, now I see why we can't move the pValue calculation. Sorry for that :)

@arj03 arj03 merged commit 2edc579 into master Apr 4, 2022
@arj03 arj03 deleted the pValue branch April 4, 2022 08:48
@staltz
Copy link
Member

staltz commented Apr 4, 2022

@arj03 By the way, I just had an idea for using WeakMap so that we don't need to recalculate any of these pointers. It could be put into BIPF and would work transparently. Then we could revert these pValue changes and we would still have the same performance benefits

@arj03
Copy link
Member Author

arj03 commented Apr 4, 2022

Uhh nice!

@github-actions
Copy link

github-actions bot commented Apr 4, 2022

Benchmark results

Part Duration
add 1000 elements 509ms
add 1000 private box1 elements 1412ms
unbox 1000 private box1 elements first run 166ms
unbox 1000 private box1 elements second run 124ms
add 1000 private box1 elements 1372ms
query 1000 elements first run 34ms
query 1000 elements second run 16ms
add 1000 private box2 elements 781ms
unbox 1000 private box2 elements first run 442ms
unbox 1000 private box2 elements second run 435ms
Migrate (+db1) 14705ms
Migrate (alone) 5230ms
Migrate (+db1 +db2) 10758ms
Migrate (+db2) 7441ms
Migrate continuation (+db2) 1232ms
Memory usage without indexes 736.76 MB = 31.09 MB + etc
Initial indexing 755ms
Initial indexing maxCpu=86 4685ms
Initial indexing compat 968ms
Two indexes updating concurrently 1081ms
key one initial 59ms
key two 4ms
key one again 2ms
reboot and key one again 51ms
latest root posts 729ms
latest posts 17ms
votes one initial 587ms
votes again 2ms
hasRoot 461ms
hasRoot again 1ms
author one posts 361ms
author two posts 18ms
dedicated author one posts 344ms
dedicated author one posts again 2ms
Maximum memory usage 799.99 MB = 44.66 MB + etc
Indexes folder size 12.76mb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants