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

Move MVCCKey encoding into C++. #3337

Merged
merged 1 commit into from
Dec 9, 2015
Merged

Move MVCCKey encoding into C++. #3337

merged 1 commit into from
Dec 9, 2015

Conversation

petermattis
Copy link
Collaborator

Changed all of the Engine/Iterator interfaces to use MVCCKeys. Moving
the MVCCKey encoding from Go to C++ simplifies the usage of
MVCCKeys. The MVCCKey type is now a structure composed of a roachpb.Key
and a timestamp. This is both more convenient to use and a minor perf
win, though the motivation behind this change was to pave the way to
using a custom RocksDB comparator.

name                                old time/op    new time/op    delta
MVCCScan1Version1Row8Bytes-8          4.70µs ± 2%    4.46µs ± 1%   -5.01% (p=0.000 n=9+8)
MVCCScan1Version10Rows8Bytes-8        23.7µs ± 1%    22.6µs ± 0%   -4.95% (p=0.000 n=10+9)
MVCCScan1Version100Rows8Bytes-8        200µs ± 1%     190µs ± 1%   -4.81% (p=0.000 n=9+9)
MVCCScan1Version1000Rows8Bytes-8      1.94ms ± 0%    1.85ms ± 0%   -4.39% (p=0.000 n=9+10)

Review on Reviewable

@@ -125,6 +125,8 @@ message RaftSnapshotData {
message KeyValue {
optional bytes key = 1;
optional bytes value = 2;
optional int64 wall_time = 3 [(gogoproto.nullable) = false];
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we embed a roachpb.Timestamp here or does that add noticeable overhead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Probably. I had an import issue with the protos and meant to revisit this. I had used separate fields purely for expediency during development.

@bdarnell
Copy link
Contributor

bdarnell commented Dec 7, 2015

LGTM

Changed all of the Engine/Iterator interfaces to use MVCCKeys. Moving
the MVCCKey encoding from Go to C++ simplifies the usage of
MVCCKeys. The MVCCKey type is now a structure composed of a roachpb.Key
and a timestamp. This is both more convenient to use and a minor perf
win, though the motivation behind this change was to pave the way to
using a custom RocksDB comparator.

name                                old time/op    new time/op    delta
MVCCScan1Version1Row8Bytes-8          4.70µs ± 2%    4.46µs ± 1%   -5.01% (p=0.000 n=9+8)
MVCCScan1Version10Rows8Bytes-8        23.7µs ± 1%    22.6µs ± 0%   -4.95% (p=0.000 n=10+9)
MVCCScan1Version100Rows8Bytes-8        200µs ± 1%     190µs ± 1%   -4.81% (p=0.000 n=9+9)
MVCCScan1Version1000Rows8Bytes-8      1.94ms ± 0%    1.85ms ± 0%   -4.39% (p=0.000 n=9+10)
petermattis added a commit that referenced this pull request Dec 9, 2015
@petermattis petermattis merged commit 5d5910f into master Dec 9, 2015
@petermattis petermattis deleted the pmattis/mvcc-key branch December 9, 2015 19:42
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.

None yet

2 participants