MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / main

Function main

compute/perf/perf_stl_merge.cpp:17–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15#include "perf.hpp"
16
17int main(int argc, char *argv[])
18{
19 perf_parse_args(argc, argv);
20
21 std::cout << "size: " << PERF_N << std::endl;
22 std::vector<int> v1 = generate_random_vector<int>(std::floor(PERF_N / 2.0));
23 std::vector<int> v2 = generate_random_vector<int>(std::ceil(PERF_N / 2.0));
24 std::vector<int> v3(PERF_N);
25
26 std::sort(v1.begin(), v1.end());
27 std::sort(v2.begin(), v2.end());
28
29 perf_timer t;
30 for(size_t trial = 0; trial < PERF_TRIALS; trial++){
31 t.start();
32 std::merge(v1.begin(), v1.end(), v2.begin(), v2.end(), v3.begin());
33 t.stop();
34 }
35 std::cout << "time: " << t.min_time() / 1e6 << " ms" << std::endl;
36
37 return 0;
38}

Callers

nothing calls this directly

Calls 8

perf_parse_argsFunction · 0.85
sortFunction · 0.85
mergeFunction · 0.85
startMethod · 0.80
stopMethod · 0.80
min_timeMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected