-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
bloom cache: investigate lockless bloom filter #3479
Comments
I have experimented with it a bit, using CompareAndSwap and Load from atomic package Mutex:
Atomic:
It is 25% improvement in Add time and 265% Has time. Also the non-atomic Has it only 1% faster than atomic one. You can see changes in: https://github.com/gxed/bbloom/compare/master...gxed:feat/atomic?expand=1 |
Those are some nice gains, what does that translate to in real world workloads? |
Nothing major currently (our getaways are handling 1000 Has/s currently but it will only rise), although it is in critical path of every IPFS blockstore operation so in future it might be worth optimizing. It also would prevent heavy add operations from slowing down the bloom cache (write lock). (and benchmarking it was a bit of my guilt pleasure after fighting with the coverage). |
Well, i'm all for performance improvements. |
We have to use thread safe bloom filter, but locks are major overhead in there.
It might be worth investigating how to make it works lockless with CompareAndSwapT function family.
The text was updated successfully, but these errors were encountered: