benchmark/benchmark_runner.cpp
// The task sizes and iteration numbers come from the Driver Perfomance Benchmarking Reference Doc.
The task sizes and iteration numbers come from the Driver Perfomance Benchmarking Reference Doc.
The task sizes and iteration numbers come from the Driver Perfomance Benchmarking Reference Doc .
benchmark_runner::benchmark_runner(std::set<benchmark_type> types) : _types{types} {
    using bsoncxx::stdx::make_unique;
    _microbenches.push_back(
        make_unique<bson_encoding>("TestFlatEncoding", 75.31, "extended_bson/flat_bson.json"));
    _microbenches.push_back(
        make_unique<bson_encoding>("TestDeepEncoding", 19.64, "extended_bson/deep_bson.json"));
    _microbenches.push_back(
        make_unique<bson_encoding>("TestFullEncoding", 57.34, "extended_bson/full_bson.json"));
    _microbenches.push_back(make_unique<run_command>());
    _microbenches.push_back(make_unique<find_one_by_id>("single_and_multi_document/tweet.json"));
    _microbenches.push_back(make_unique<insert_one>(
        "TestSmallDocInsertOne", 2.75, 10000, "single_and_multi_document/small_doc.json"));
    _microbenches.push_back(make_unique<insert_one>(
        "TestLargeDocInsertOne", 27.31, 10, "single_and_multi_document/large_doc.json"));
    _microbenches.push_back(make_unique<find_many>("single_and_multi_document/tweet.json"));
    _microbenches.push_back(make_unique<bulk_insert>(
        "TestSmallDocBulkInsert", 2.75, 10000, "single_and_multi_document/small_doc.json"));
    _microbenches.push_back(make_unique<bulk_insert>(
        "TestLargeDocBulkInsert", 27.31, 10, "single_and_multi_document/large_doc.json"));
    _microbenches.push_back(
        make_unique<gridfs_upload>("single_and_multi_document/gridfs_large.bin"));
    _microbenches.push_back(
        make_unique<gridfs_download>("single_and_multi_document/gridfs_large.bin"));
    _microbenches.push_back(make_unique<json_multi_import>("parallel/ldjson_multi"));
    _microbenches.push_back(make_unique<json_multi_export>("parallel/ldjson_multi"));
    _microbenches.push_back(make_unique<gridfs_multi_import>("parallel/gridfs_multi"));
    _microbenches.push_back(make_unique<gridfs_multi_export>("parallel/gridfs_multi"));
    if (!_types.empty()) {
        for (auto&& it = _microbenches.begin(); it != _microbenches.end();) {
            const std::set<benchmark_type>& tags = (*it)->get_tags();
            std::set<benchmark_type> intersect;
            std::set_intersection(tags.begin(),
                                  tags.end(),
                                  _types.begin(),
                                  _types.end(),
                                  std::inserter(intersect, intersect.begin()));
            if (intersect.empty()) {
                _microbenches.erase(it);
            } else {
                ++it;
            }
        }
    }
}
benchmark_runner :: benchmark_runner ( std :: set < benchmark_type > types ) : _types { types } { using bsoncxx :: stdx :: make_unique ; _microbenches . push_back ( make_unique < bson_encoding > ( " " , 75.31 , " " ) ) ; _microbenches . push_back ( make_unique < bson_encoding > ( " " , 19.64 , " " ) ) ; _microbenches . push_back ( make_unique < bson_encoding > ( " " , 57.34 , " " ) ) ; _microbenches . push_back ( make_unique < run_command > ( ) ) ; _microbenches . push_back ( make_unique < find_one_by_id > ( " " ) ) ; _microbenches . push_back ( make_unique < insert_one > ( " " , 2.75 , 10000 , " " ) ) ; _microbenches . push_back ( make_unique < insert_one > ( " " , 27.31 , 10 , " " ) ) ; _microbenches . push_back ( make_unique < find_many > ( " " ) ) ; _microbenches . push_back ( make_unique < bulk_insert > ( " " , 2.75 , 10000 , " " ) ) ; _microbenches . push_back ( make_unique < bulk_insert > ( " " , 27.31 , 10 , " " ) ) ; _microbenches . push_back ( make_unique < gridfs_upload > ( " " ) ) ; _microbenches . push_back ( make_unique < gridfs_download > ( " " ) ) ; _microbenches . push_back ( make_unique < json_multi_import > ( " " ) ) ; _microbenches . push_back ( make_unique < json_multi_export > ( " " ) ) ; _microbenches . push_back ( make_unique < gridfs_multi_import > ( " " ) ) ; _microbenches . push_back ( make_unique < gridfs_multi_export > ( " " ) ) ; if ( ! _types . empty ( ) ) { for ( auto && it = _microbenches . begin ( ) ; it != _microbenches . end ( ) ; ) { const std :: set < benchmark_type > & tags = ( * it ) -> get_tags ( ) ; std :: set < benchmark_type > intersect ; std :: set_intersection ( tags . begin ( ) , tags . end ( ) , _types . begin ( ) , _types . end ( ) , std :: inserter ( intersect , intersect . begin ( ) ) ) ; if ( intersect . empty ( ) ) { _microbenches . erase ( it ) ; } else { ++ it ; } } } }
The task sizes and iteration numbers come from the Driver Perfomance Benchmarking Reference Doc.
The task sizes and iteration numbers come from the Driver Perfomance Benchmarking Reference Doc .
// Bson microbenchmarks // TODO CXX-1241: Add bson_decoding equivalents. // Single doc microbenchmarks // Multi doc microbenchmarks // Parallel microbenchmarks // Need to remove some