forked from tikv/tikv
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge pingcap/release-3.1 until (tikv#7762)
txn: only wake up waiters when locks are indeed released (tikv#7379) (tikv#7585) Signed-off-by: youjiali1995 <zlwgx1023@gmail.com> txn: don't protect rollback for BatchRollback (tikv#7605) (tikv#7608) Signed-off-by: youjiali1995 <zlwgx1023@gmail.com> tidb_query: add is true/false keep null ScalarFuncSig (tikv#7532) (tikv#7566) Signed-off-by: zhongzc <zhongzc_arch@outlook.com> tidb_query: fix the logical behavior of floats (tikv#7342) (tikv#7582) Signed-off-by: zhongzc <zhongzc_arch@outlook.com> tidb_query: fix converting bytes to bool (tikv#7486) (tikv#7547) Signed-off-by: zhongzc <zhongzc_arch@outlook.com> raftstore: change the condition of proposing rollback merge (tikv#6584) (tikv#7762) Signed-off-by: Liqi Geng <gengliqiii@gmail.com> Signed-off-by: Tong Zhigao <tongzhigao@pingcap.com>
- Loading branch information
Showing
21 changed files
with
837 additions
and
242 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0. | ||
|
||
use rand::{self, Rng, RngCore}; | ||
use tikv::coprocessor::codec::{datum, table, Datum}; | ||
use tikv::storage::Key; | ||
|
||
#[inline] | ||
fn gen_rand_str(len: usize) -> Vec<u8> { | ||
let mut rand_str = vec![0; len]; | ||
rand::thread_rng().fill_bytes(&mut rand_str); | ||
rand_str | ||
} | ||
|
||
#[bench] | ||
fn bench_row_key_gen_hash(b: &mut test::Bencher) { | ||
let id: i64 = rand::thread_rng().gen(); | ||
let row_key = Key::from_raw(&table::encode_row_key(id, id)); | ||
b.iter(|| { | ||
test::black_box(row_key.gen_hash()); | ||
}); | ||
} | ||
|
||
#[bench] | ||
fn bench_index_key_gen_hash(b: &mut test::Bencher) { | ||
let id: i64 = rand::thread_rng().gen(); | ||
let encoded_index_val = datum::encode_key(&[Datum::Bytes(gen_rand_str(64))]).unwrap(); | ||
let index_key = Key::from_raw(&table::encode_index_seek_key(id, id, &encoded_index_val)); | ||
b.iter(|| { | ||
test::black_box(index_key.gen_hash()); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Copyright 2018 TiKV Project Authors. Licensed under Apache-2.0. | ||
|
||
mod key; | ||
mod scan; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.