{"action":"created","issue":{"url":"https://api.github.com/repos/tikv/tikv/issues/3787","repository_url":"https://api.github.com/repos/tikv/tikv","labels_url":"https://api.github.com/repos/tikv/tikv/issues/3787/labels{/name}","comments_url":"https://api.github.com/repos/tikv/tikv/issues/3787/comments","events_url":"https://api.github.com/repos/tikv/tikv/issues/3787/events","html_url":"https://github.com/tikv/tikv/pull/3787","id":380680392,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMwODIxMTU5","number":3787,"title":"benches: add benchmarks for BTreeEngine","user":{"login":"Hijiao","id":12491451,"node_id":"MDQ6VXNlcjEyNDkxNDUx","avatar_url":"https://avatars1.githubusercontent.com/u/12491451?v=4","gravatar_id":"","url":"https://api.github.com/users/Hijiao","html_url":"https://github.com/Hijiao","followers_url":"https://api.github.com/users/Hijiao/followers","following_url":"https://api.github.com/users/Hijiao/following{/other_user}","gists_url":"https://api.github.com/users/Hijiao/gists{/gist_id}","starred_url":"https://api.github.com/users/Hijiao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hijiao/subscriptions","organizations_url":"https://api.github.com/users/Hijiao/orgs","repos_url":"https://api.github.com/users/Hijiao/repos","events_url":"https://api.github.com/users/Hijiao/events{/privacy}","received_events_url":"https://api.github.com/users/Hijiao/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-14T12:41:27Z","updated_at":"2018-11-14T12:42:51Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/tikv/tikv/pulls/3787","html_url":"https://github.com/tikv/tikv/pull/3787","diff_url":"https://github.com/tikv/tikv/pull/3787.diff","patch_url":"https://github.com/tikv/tikv/pull/3787.patch"},"body":"Signed-off-by: Max <xiahaijiao@hotmail.com>\r\n\r\n<!--\r\nThank you for contributing to TiKV! Please read TiKV's [CONTRIBUTING](https://github.com/tikv/tikv/blob/master/CONTRIBUTING.md) document **BEFORE** filing this PR.\r\n-->\r\n\r\n## What have you changed? (mandatory)\r\n\r\nAppend benchmarks for BTreeEngine. #3723 \r\nMeasuring the performance of `Engine::snapshot()`, `Engine::put()` and `Engine::Snapshot::get()`.\r\n\r\n## What are the type of the changes? (mandatory)\r\n\r\nThe currently defined types are listed below, please pick one of the types for this PR by removing the others:\r\n- Improvement (non-breaking change which is an improvement to an existing feature)\r\n\r\n## How has this PR been tested? (mandatory)\r\nIt works locally\r\n\r\n## Does this PR affect documentation (docs/docs-cn) update? (mandatory)\r\n\r\nNo\r\n\r\n## Does this PR affect tidb-ansible update? (mandatory)\r\n\r\nNo\r\n## Refer to a related PR or issue link (optional)\r\n#3723 \r\n## Benchmark result if necessary (optional)\r\nrun \r\n\r\n> cargo bench -- bench benches bench_engine\r\n\r\n```log\r\ntest storage::engine::bench_btree_engine::bench_engine_get_btree_1000_times_from_000_000_size        ... bench:     198,010 ns/iter (+/- 26,811)\r\ntest storage::engine::bench_btree_engine::bench_engine_get_btree_1000_times_from_001_000_size        ... bench:     325,734 ns/iter (+/- 58,219)\r\ntest storage::engine::bench_btree_engine::bench_engine_get_btree_1000_times_from_010_000_size        ... bench:     405,420 ns/iter (+/- 111,610)\r\ntest storage::engine::bench_btree_engine::bench_engine_get_btree_1000_times_from_100_000_size        ... bench:     567,249 ns/iter (+/- 121,747)\r\ntest storage::engine::bench_btree_engine::bench_engine_get_btree_1000_times_from_1_000_000_size      ... bench:     786,706 ns/iter (+/- 418,780)\r\ntest storage::engine::bench_btree_engine::bench_engine_put_btree_001_000_items                       ... bench:     561,306 ns/iter (+/- 125,090)\r\ntest storage::engine::bench_btree_engine::bench_engine_put_btree_010_000_items                       ... bench:   7,253,972 ns/iter (+/- 7,093,772)\r\ntest storage::engine::bench_btree_engine::bench_engine_put_btree_100_000_items                       ... bench: 105,177,869 ns/iter (+/- 8,846,770)\r\ntest storage::engine::bench_btree_engine::bench_engine_snapshot_btree_1000_times_from_000_000_size   ... bench:     292,920 ns/iter (+/- 58,836)\r\ntest storage::engine::bench_btree_engine::bench_engine_snapshot_btree_1000_times_from_001_000_size   ... bench:     291,714 ns/iter (+/- 78,780)\r\ntest storage::engine::bench_btree_engine::bench_engine_snapshot_btree_1000_times_from_010_000_size   ... bench:     283,661 ns/iter (+/- 64,883)\r\ntest storage::engine::bench_btree_engine::bench_engine_snapshot_btree_1000_times_from_100_000_size   ... bench:     292,909 ns/iter (+/- 63,610)\r\ntest storage::engine::bench_btree_engine::bench_engine_snapshot_btree_1000_times_from_1_000_000_size ... bench:     282,125 ns/iter (+/- 59,494)\r\ntest storage::engine::bench_rocksdb::bench_engine_get_rocks_1000_times_from_000_000_size             ... bench:   1,331,309 ns/iter (+/- 164,420)\r\ntest storage::engine::bench_rocksdb::bench_engine_get_rocks_1000_times_from_001_000_size             ... bench:   1,678,503 ns/iter (+/- 243,585)\r\ntest storage::engine::bench_rocksdb::bench_engine_get_rocks_1000_times_from_010_000_size             ... bench:   1,801,196 ns/iter (+/- 194,378)\r\ntest storage::engine::bench_rocksdb::bench_engine_get_rocks_1000_times_from_100_000_size             ... bench:   2,041,961 ns/iter (+/- 408,548)\r\ntest storage::engine::bench_rocksdb::bench_engine_get_rocks_1000_times_from_1_000_000_size           ... bench:   2,509,437 ns/iter (+/- 809,402)\r\ntest storage::engine::bench_rocksdb::bench_engine_put_rocks_001_000_items                            ... bench:  21,154,886 ns/iter (+/- 6,099,700)\r\ntest storage::engine::bench_rocksdb::bench_engine_put_rocks_010_000_items                            ... bench: 215,708,780 ns/iter (+/- 32,595,225)\r\ntest storage::engine::bench_rocksdb::bench_engine_put_rocks_100_000_items                            ... bench: 2,211,550,830 ns/iter (+/- 468,339,933)\r\ntest storage::engine::bench_rocksdb::bench_engine_snapshot_rocks_1000_times_from_000_000_size        ... bench:  11,413,030 ns/iter (+/- 5,391,378)\r\ntest storage::engine::bench_rocksdb::bench_engine_snapshot_rocks_1000_times_from_001_000_size        ... bench:  11,915,014 ns/iter (+/- 10,735,234)\r\ntest storage::engine::bench_rocksdb::bench_engine_snapshot_rocks_1000_times_from_010_000_size        ... bench:  10,547,892 ns/iter (+/- 1,936,265)\r\ntest storage::engine::bench_rocksdb::bench_engine_snapshot_rocks_1000_times_from_100_000_size        ... bench:  11,380,408 ns/iter (+/- 2,275,662)\r\ntest storage::engine::bench_rocksdb::bench_engine_snapshot_rocks_1000_times_from_1_000_000_size      ... bench:  11,070,405 ns/iter (+/- 2,286,671)\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/tikv/tikv/issues/comments/438648962","html_url":"https://github.com/tikv/tikv/pull/3787#issuecomment-438648962","issue_url":"https://api.github.com/repos/tikv/tikv/issues/3787","id":438648962,"node_id":"MDEyOklzc3VlQ29tbWVudDQzODY0ODk2Mg==","user":{"login":"Hijiao","id":12491451,"node_id":"MDQ6VXNlcjEyNDkxNDUx","avatar_url":"https://avatars1.githubusercontent.com/u/12491451?v=4","gravatar_id":"","url":"https://api.github.com/users/Hijiao","html_url":"https://github.com/Hijiao","followers_url":"https://api.github.com/users/Hijiao/followers","following_url":"https://api.github.com/users/Hijiao/following{/other_user}","gists_url":"https://api.github.com/users/Hijiao/gists{/gist_id}","starred_url":"https://api.github.com/users/Hijiao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hijiao/subscriptions","organizations_url":"https://api.github.com/users/Hijiao/orgs","repos_url":"https://api.github.com/users/Hijiao/repos","events_url":"https://api.github.com/users/Hijiao/events{/privacy}","received_events_url":"https://api.github.com/users/Hijiao/received_events","type":"User","site_admin":false},"created_at":"2018-11-14T12:42:51Z","updated_at":"2018-11-14T12:42:51Z","author_association":"CONTRIBUTOR","body":"### Conclusion:\r\nThe BTreeEngine is faster than RocksDB.\r\n+  3 ~ 4 times faster in `Engine::snapshot()`\r\n+  4 ~ 7 times faster in `Snapshot.get()`\r\n+  22 ~ 40 times faster in `Engine::write()`\r\n"}}
{"actor":{"display_login":"Hijiao"}}