当前位置: 首页>>代码示例>>C++>>正文


C++ Benchmark::measure_speed方法代码示例

本文整理汇总了C++中Benchmark::measure_speed方法的典型用法代码示例。如果您正苦于以下问题:C++ Benchmark::measure_speed方法的具体用法?C++ Benchmark::measure_speed怎么用?C++ Benchmark::measure_speed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Benchmark的用法示例。


在下文中一共展示了Benchmark::measure_speed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main


//.........这里部分代码省略.........
    else if (BMCONFIG.bm_name == "FineGrainList")
        B = new IntSetBench(new FGL(), BMCONFIG.datasetsize);
    else if (BMCONFIG.bm_name == "FineGrainHash")
        B = new IntSetBench(new bench::HashTable<FGL>(), BMCONFIG.datasetsize);
    else if (BMCONFIG.bm_name == "CoarseGrainHash")
        B = new IntSetBench(new CGHash(), BMCONFIG.datasetsize);
    else if (BMCONFIG.bm_name == "RandomGraph")
        B = new RGBench(BMCONFIG.datasetsize);
    else if (BMCONFIG.bm_name == "HashTable")
        B = new IntSetBench(new bench::Hash(), BMCONFIG.datasetsize);
    else if (BMCONFIG.bm_name == "LFUCache")
        B = new LFUTest();
    else if (BMCONFIG.bm_name == "LinkedList")
        B = new IntSetBench(new LinkedList(), BMCONFIG.datasetsize);
    else if (BMCONFIG.bm_name == "LinkedListRelease")
        B = new IntSetBench(new LinkedListRelease(), BMCONFIG.datasetsize);
    else if (BMCONFIG.bm_name == "DList")
        B = new IntSetBench(new DList(BMCONFIG.datasetsize),
                            BMCONFIG.datasetsize);
    else if (BMCONFIG.bm_name == "PrivList")
        B = new PrivList(BMCONFIG.datasetsize);
    else if (BMCONFIG.bm_name == "TypeTest")
        B = new TypeTest(BMCONFIG.datasetsize);
    else if (BMCONFIG.bm_name == "VerifyRetry")
        B = new VerifyRetry(BMCONFIG.datasetsize);
    else if (BMCONFIG.bm_name == "VerifyNesting")
        B = new VerifyNesting(BMCONFIG.datasetsize);
    else if (BMCONFIG.bm_name == "RBTree")
        B = new IntSetBench(new RBTree(), BMCONFIG.datasetsize);
    else if (BMCONFIG.bm_name == "RBTreeLarge")
        B = new IntSetBench(new RBTreeLarge(), BMCONFIG.datasetsize);
    else if (BMCONFIG.bm_name == "WWPathology")
        B = new WWPathology(BMCONFIG.datasetsize);
    else if (BMCONFIG.bm_name.substr(0,11) == "StridePathology") {
        string str = BMCONFIG.bm_name;
        int pos1 = str.find_first_of('-', 0);
        int pos2 = str.size();
        int size = atoi(str.substr(pos1+1, pos2-pos1-1).c_str());
        B = new StridePathology(BMCONFIG.datasetsize, size);
    }
    else if (BMCONFIG.bm_name.substr(0,6) == "Forest") {
        string str = BMCONFIG.bm_name;
        int pos1 = str.find_first_of('-', 0);
        int pos2 = str.size();
        string configstr = str.substr(pos1+1, pos2-pos1-1).c_str();
        B = new Forest(configstr);
    }
    else if (BMCONFIG.bm_name.substr(0,14) == "RWPathology") {
        string str = BMCONFIG.bm_name;
        int pos1 = str.find_first_of('-', 0);
        int pos2 = str.size();
        int size = atoi(str.substr(pos1+1, pos2-pos1-1).c_str());
        B = new RWPathology(BMCONFIG.datasetsize, size);
    }
    else if (BMCONFIG.bm_name.substr(0,8) == "PrivTree") {
        string str = BMCONFIG.bm_name;
        int pos1 = str.find_first_of('-', 0);
        int pos2 = str.size();
        int size = atoi(str.substr(pos1+1, pos2-pos1-1).c_str());
        B = new PrivTree(BMCONFIG.datasetsize, size);
    }
    else if (BMCONFIG.bm_name == "RBTree256") {
        BMCONFIG.datasetsize = 256;
        BMCONFIG.doWarmup = true;
        B = new IntSetBench(new RBTree(), BMCONFIG.datasetsize);
    }
    else if (BMCONFIG.bm_name == "RBTree1K") {
        BMCONFIG.datasetsize = 1024;
        BMCONFIG.doWarmup = true;
        B = new IntSetBench(new RBTree(), BMCONFIG.datasetsize);
    }
    else if (BMCONFIG.bm_name == "RBTree64K") {
        BMCONFIG.datasetsize = 65536;
        BMCONFIG.doWarmup = true;
        B = new IntSetBench(new RBTree(), BMCONFIG.datasetsize);
    }
    else if (BMCONFIG.bm_name == "RBTree1M") {
        BMCONFIG.datasetsize = 1048576;
        BMCONFIG.doWarmup = true;
        B = new IntSetBench(new RBTree(), BMCONFIG.datasetsize);
    }
    else if (BMCONFIG.bm_name == "ListOverwriter")
        B = new ListOverwriter(BMCONFIG.datasetsize);
    else
        argError("Unrecognized benchmark name " + BMCONFIG.bm_name);

    // print the configuration for this run of the benchmark
    BMCONFIG.printConfig();

    // either verify the data structure or run a timing experiment
    if (BMCONFIG.unit_testing != ' ') {
        if (B->verify(BMCONFIG.unit_testing == 'l' ? LIGHT : HEAVY))
            cout << "Verification succeeded" << endl;
        else
            cout << "Verification failed" << endl;
    }
    else {
        B->measure_speed();
    }
}
开发者ID:shambakey1,项目名称:rstm_r5,代码行数:101,代码来源:BenchMain.cpp


注:本文中的Benchmark::measure_speed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。