-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
an optimization for FindNextUserEntryInternal #151
Comments
I had posted this earlier here: If you could provide a diff (or a pull request) against the rocksdb code base, that will be a great step to get it reviewed and committed. The optimization would make sense when a workload inserts the same key multiple times within a relatively short period of time. |
I just realized a problem with this approach -- DBIter is also used on top of table files, not only memtables. I don't think this is fixable. |
@dhruba @igorcanadi |
shuttler: your observation is good. If you can provide a patch (after incorporating a fix for the problem mentioned by Igor), that would be great. |
@dhruba |
As you mentioned: But I guess there is no(or a bit) affects with this patch.
that is fast enough, because 'memcmp'(glibc) internal is blocks compare. |
this is an interesting idea. I feel the improvement will come from a very specific workload. I'd expect majority of keys will be unique in the memtable? |
@ljinfb |
ljinfb: are you saying that this problem is fixed and we do not need this patch? |
@dhruba no, it is not fixed. His patch (link does not seem to work, based on my guess) only applies to skiplist. If we try to remove that compare in DBIter, the same thing needs to be fixed in all memtable formats as well as SSTs. I am not sure if that is possible |
Closing this issue due to inactivity. @BohuTANG if you could provide a pull request and show performance improvements, we will gladly merge it into our source tree. |
Summary: Introduce `KeyManagedEncryptedEnv` which wraps around `EncryptedEnv` but provides an `KeyManager` API to enable key management per file. Also implements `AESBlockCipher` with OpenSSL. Test Plan: not tested yet. will update. Signed-off-by: Yi Wu <[email protected]>
Summary: Introduce `KeyManagedEncryptedEnv` which wraps around `EncryptedEnv` but provides an `KeyManager` API to enable key management per file. Also implements `AESBlockCipher` with OpenSSL. Test Plan: not tested yet. will update. Signed-off-by: Yi Wu <[email protected]> Signed-off-by: tabokie <[email protected]>
Summary: Introduce `KeyManagedEncryptedEnv` which wraps around `EncryptedEnv` but provides an `KeyManager` API to enable key management per file. Also implements `AESBlockCipher` with OpenSSL. Test Plan: not tested yet. will update. Signed-off-by: Yi Wu <[email protected]> Signed-off-by: tabokie <[email protected]>
Summary: Introduce `KeyManagedEncryptedEnv` which wraps around `EncryptedEnv` but provides an `KeyManager` API to enable key management per file. Also implements `AESBlockCipher` with OpenSSL. Test Plan: not tested yet. will update. Signed-off-by: Yi Wu <[email protected]> Signed-off-by: tabokie <[email protected]>
Summary: Introduce `KeyManagedEncryptedEnv` which wraps around `EncryptedEnv` but provides an `KeyManager` API to enable key management per file. Also implements `AESBlockCipher` with OpenSSL. Test Plan: not tested yet. will update. Signed-off-by: Yi Wu <[email protected]> Signed-off-by: tabokie <[email protected]>
I've seen many innovations on rocksdb based on leveldb.
But, there is a hole we can do to improve.
As in skiplist, the internal key packed as:
{sequence|type|user_key|value}
if one key in skiplist is:
then, we insert same key with different value:
So, the same key is in two nodes, when we fall in the 'hot' function 'DBIter::FindNextUserEntryInternal', we have to do as follows:
if we changed the node structure from:
to
We don't need to do user_comparator_->Compare.
The 'iter->next' means that i am a 'restart'&'difference' key.
The OK version is here:
https://github.com/shuttler/nessDB/blob/master/engine/skiplist.h
https://github.com/shuttler/nessDB/blob/master/engine/skiplist.c
-BohuTANG
The text was updated successfully, but these errors were encountered: