forked from apache/kudu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tablet] Optimize TabletMetadata::CollectBlockIds efficiency
Container size may reallocate and elements will be moved or copied several times if using std::vector and inserting elements at the beginning in TabletMetadata::CollectBlockIds, we'd better to insert elements at the end. We did some simple benchmarks for TabletMetadata::CollectBlockIds() operation in TestTabletMetadata.BenchmarkCollectBlockIds, compared with old version, result shows that inserting at the end provides a linear time cost when block count per RowSet or RowSet count increasing. And also, we ran benchmarks to compare std::vector with std::list and std::deque, both of them have worse efficiency. Result details as follow: (The first column is FLAGS_test_row_set_count/FLAGS_test_block_count_per_rs, the other columns show 10 times total TabletMetadata::CollectBlockIds() time cost, in millisecond.) vector list deque vector (head insert) (rear insert) 1000/1000 3464 687 334 321 2000/1000 15238 1390 647 613 4000/1000 75139 3057 1392 1212 8000/1000 328808 6593 2805 2736 4000/2000 159517 6488 2965 2462 4000/4000 348471 11967 5513 5141 4000/8000 -(too long) 23706 11704 10806 Change-Id: I7ce853e35eb7dfa9f9a099e465ea8edfaa7c4aa9 Reviewed-on: http://gerrit.cloudera.org:8080/14445 Tested-by: Kudu Jenkins Reviewed-by: Adar Dembo <[email protected]>
- Loading branch information
Showing
11 changed files
with
80 additions
and
38 deletions.
There are no files selected for viewing
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
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
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