-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
table: avoid redundant encode in insert/update/delete. #11532
Conversation
/run-all-tests |
@eurekaka PTAL |
Codecov Report
@@ Coverage Diff @@
## master #11532 +/- ##
===============================================
- Coverage 81.7785% 81.256% -0.5226%
===============================================
Files 426 426
Lines 94345 92035 -2310
===============================================
- Hits 77154 74784 -2370
- Misses 11788 11872 +84
+ Partials 5403 5379 -24 |
@eurekaka PTAL |
/run-all-tests |
/run-all-tests |
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.
LGTM
/run-all-tests |
util/codec/codec.go
Outdated
@@ -201,6 +237,21 @@ func encodeSignedInt(b []byte, v int64, comparable bool) []byte { | |||
return b | |||
} | |||
|
|||
var varIntSize = []int64{64, 8192, 1048576, 134217728, 17179869184, 2199023255552, 281474976710656, 36028797018963968, 4611686018427387904} |
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.
Is it possible to use some bit shifts?
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.
great, thanks.done.
util/codec/codec.go
Outdated
@@ -212,6 +263,17 @@ func encodeUnsignedInt(b []byte, v uint64, comparable bool) []byte { | |||
return b | |||
} | |||
|
|||
var varUintSize = []uint64{128, 16384, 2097152, 268435456, 34359738368, 4398046511104, 562949953421312, 72057594037927936, 9223372036854775808} |
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.
ditto
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.
great, thanks.done.
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.
rest LGTM
/run-all-tests |
/run-unit-test |
What problem does this PR solve?
Benchmark AddRecord function
benchmark insert
Use prepare to batch insert 50w rows to table, which table contains 60 columns, 20 int columns, 20 timestamp columns, 20 varchar(50) columns.
Before This PR
This PR
benchmark update
Before This PR
This PR
benchmark delete
Before This PR
This PR
What is changed and how it works?
Check List
Tests
Code changes
Side effects
Related changes