-
-
Save brson/13586d9f12f3af5c8377628c3d0f12d0 to your computer and use it in GitHub Desktop.
TiKV rust upgrade to nightly-2012-12-06 benchmarks
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
+ cargo benchcmp misc-before.txt misc-after.txt | |
name misc-before.txt ns/iter misc-after.txt ns/iter diff ns/iter diff % speedup | |
_bench_check_requirement 0 0 0 NaN% x NaN | |
channel::bench_channel::bench_crossbeam_channel 39 39 0 0.00% x 1.00 | |
channel::bench_channel::bench_mio_channel 155 148 -7 -4.52% x 1.05 | |
channel::bench_channel::bench_receiver_stream 1,858,467 1,869,328 10,861 0.58% x 0.99 | |
channel::bench_channel::bench_receiver_stream_batch 1,103,490 1,103,264 -226 -0.02% x 1.00 | |
channel::bench_channel::bench_thread_channel 28 27 -1 -3.57% x 1.04 | |
channel::bench_channel::bench_util_channel 40 39 -1 -2.50% x 1.03 | |
channel::bench_channel::bench_util_loose 85 89 4 4.71% x 0.96 | |
coprocessor::codec::bench_record_prefix_bigendian_check 940 941 1 0.11% x 1.00 | |
coprocessor::codec::bench_record_prefix_equal_check 1,100 1,101 1 0.09% x 1.00 | |
coprocessor::codec::bench_record_prefix_littleendian_check 817 818 1 0.12% x 1.00 | |
coprocessor::codec::bench_record_prefix_start_with 817 826 9 1.10% x 0.99 | |
coprocessor::codec::bench_table_prefix_check 816 818 2 0.25% x 1.00 | |
coprocessor::codec::bench_table_prefix_start_with 816 819 3 0.37% x 1.00 | |
coprocessor::codec::chunk::bench_chunk_build_offical 63,145 62,897 -248 -0.39% x 1.00 | |
coprocessor::codec::chunk::bench_chunk_build_tidb 29,878 28,900 -978 -3.27% x 1.03 | |
coprocessor::codec::chunk::bench_chunk_iter_offical 33,841 37,339 3,498 10.34% x 0.91 | |
coprocessor::codec::chunk::bench_chunk_iter_tidb 38,088 38,639 551 1.45% x 0.99 | |
coprocessor::codec::chunk::bench_encode_chunk 18,284 21,912 3,628 19.84% x 0.83 | |
coprocessor::dag::expr::scalar::bench_get_scalar_args_with_map 3,387 3,361 -26 -0.77% x 1.01 | |
coprocessor::dag::expr::scalar::bench_get_scalar_args_with_match 1,137 1,133 -4 -0.35% x 1.00 | |
raftkv::bench_async_snapshot 1,945 1,888 -57 -2.93% x 1.03 | |
raftkv::bench_async_snapshots_noop 164 177 13 7.93% x 0.93 | |
raftkv::bench_async_write 1,257 1,228 -29 -2.31% x 1.02 | |
serialization::bench_serialization::bench_decode_one 494 474 -20 -4.05% x 1.04 | |
serialization::bench_serialization::bench_decode_two 879 864 -15 -1.71% x 1.02 | |
serialization::bench_serialization::bench_encode_one 583 580 -3 -0.51% x 1.01 | |
serialization::bench_serialization::bench_encode_two 970 1,010 40 4.12% x 0.96 | |
writebatch::bench_writebatch::bench_writebatch_1 39,876,213 36,526,210 -3,350,003 -8.40% x 1.09 | |
writebatch::bench_writebatch::bench_writebatch_1024 14,261,664 13,616,758 -644,906 -4.52% x 1.05 | |
writebatch::bench_writebatch::bench_writebatch_128 14,308,605 13,507,428 -801,177 -5.60% x 1.06 | |
writebatch::bench_writebatch::bench_writebatch_16 16,245,834 15,099,810 -1,146,024 -7.05% x 1.08 | |
writebatch::bench_writebatch::bench_writebatch_2 27,658,050 25,670,234 -1,987,816 -7.19% x 1.08 | |
writebatch::bench_writebatch::bench_writebatch_256 13,912,289 12,997,538 -914,751 -6.58% x 1.07 | |
writebatch::bench_writebatch::bench_writebatch_32 14,924,121 13,702,075 -1,222,046 -8.19% x 1.09 | |
writebatch::bench_writebatch::bench_writebatch_4 21,888,783 20,360,655 -1,528,128 -6.98% x 1.08 | |
writebatch::bench_writebatch::bench_writebatch_512 13,762,431 12,134,391 -1,628,040 -11.83% x 1.13 | |
writebatch::bench_writebatch::bench_writebatch_64 14,229,843 12,149,712 -2,080,131 -14.62% x 1.17 | |
writebatch::bench_writebatch::bench_writebatch_8 18,194,036 15,890,786 -2,303,250 -12.66% x 1.14 | |
writebatch::bench_writebatch::bench_writebatch_with_capacity 10,942 5,934 -5,008 -45.77% x 1.84 | |
writebatch::bench_writebatch::bench_writebatch_without_capacity 10,317 6,282 -4,035 -39.11% x 1.64 |
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
+ cargo benchcmp tikv-before.txt tikv-after.txt | |
name tikv-before.txt ns/iter tikv-after.txt ns/iter diff ns/iter diff % speedup | |
coprocessor::codec::batch::column::benches::bench_batch_decode 27,960 28,260 300 1.07% x 0.99 | |
coprocessor::codec::batch::column::benches::bench_push_datum_int 20,659 20,143 -516 -2.50% x 1.03 | |
coprocessor::codec::batch::column::benches::bench_retain 2,638 2,388 -250 -9.48% x 1.10 | |
coprocessor::codec::batch::rows::benches::bench_lazy_batch_column_by_vec_clone 46,848 47,163 315 0.67% x 0.99 | |
coprocessor::codec::batch::rows::benches::bench_lazy_batch_column_by_vec_push_raw_10bytes 53,429 53,680 251 0.47% x 1.00 | |
coprocessor::codec::batch::rows::benches::bench_lazy_batch_column_clone 16,516 16,154 -362 -2.19% x 1.02 | |
coprocessor::codec::batch::rows::benches::bench_lazy_batch_column_clone_10bytes 53,795 54,003 208 0.39% x 1.00 | |
coprocessor::codec::batch::rows::benches::bench_lazy_batch_column_clone_and_decode 43,104 42,998 -106 -0.25% x 1.00 | |
coprocessor::codec::batch::rows::benches::bench_lazy_batch_column_clone_and_decode_decoded 321 411 90 28.04% x 0.78 | |
coprocessor::codec::batch::rows::benches::bench_lazy_batch_column_clone_decoded 312 411 99 31.73% x 0.76 | |
coprocessor::codec::batch::rows::benches::bench_lazy_batch_column_clone_naive 81,452 79,672 -1,780 -2.19% x 1.02 | |
coprocessor::codec::batch::rows::benches::bench_lazy_batch_column_push_raw_10bytes 55,041 55,829 788 1.43% x 0.99 | |
coprocessor::codec::batch::rows::benches::bench_lazy_batch_column_push_raw_4bytes 17,837 18,226 389 2.18% x 0.98 | |
coprocessor::codec::batch::rows::benches::bench_lazy_batch_column_push_raw_9bytes 17,837 18,202 365 2.05% x 0.98 | |
raftstore::store::fsm::router::tests::bench_send 153 162 9 5.88% x 0.94 | |
storage::txn::store::benches::bench_fixture_batch_get 11,884 9,438 -2,446 -20.58% x 1.26 | |
storage::txn::store::benches::bench_fixture_get 92 104 12 13.04% x 0.88 | |
storage::txn::store::benches::bench_fixture_scanner 448,679 479,242 30,563 6.81% x 0.94 | |
storage::txn::store::benches::bench_fixture_scanner_next 435,325 433,957 -1,368 -0.31% x 1.00 | |
storage::txn::store::benches::bench_fixture_scanner_scan 569,422 531,086 -38,336 -6.73% x 1.07 | |
util::codec::bytes::tests::bench_decode 2,396 3,096 700 29.22% x 0.77 | |
util::codec::bytes::tests::bench_decode_inplace 1,151 1,920 769 66.81% x 0.60 | |
util::codec::bytes::tests::bench_decode_inplace_small 36 40 4 11.11% x 0.90 | |
util::codec::bytes::tests::bench_decode_small 70 69 -1 -1.43% x 1.01 | |
util::codec::bytes::tests::bench_encode 47 46 -1 -2.13% x 1.02 | |
util::rocksdb::properties::tests::bench_mvcc_properties 2,189 1,999 -190 -8.68% x 1.10 |
I investigated why bench_memcmp_decode_first_in_place_asc_large
becomes slower, turns out the cause is that Vec clone become slower:
#[bench]
fn bench(b: &mut test::Bencher) {
let raw = vec![0u8; 1000];
b.iter(|| {
test::black_box(test::black_box(&raw).clone());
});
}
In rustc 1.29 it is 34 ns/iter (+/- 6), in rustc 1.33 it is 121 ns/iter (+/- 21).
I checked the assembly generated by try_decode_first_in_place
and bench_memcmp_decode_first_in_place_asc_large
, they are mostly the same (only some register changes and some instruction reordering). So the slowness comes from the Rust core.
I opened an issue in rust-lang/rust: rust-lang/rust#57437
Thank you so much for your help @breeswich 🙏
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bench result over efficient codec PR:
With 2019-01-01: