66 {std::cout << __PRETTY_FUNCTION__ << std::endl;
67
68 std::pair<xAOD::MissingETContainer, xAOD::MissingETAuxContainer> cont;
69 cont.first.setStore(& cont.second);
70
71 std::vector<double> stringComparisonTimes;
72 std::vector<double> hashComparisonTimes;
73
74 for(
size_t i = 0;
i < 1000; ++
i){
75 for(size_t j = 0; j < 7; ++j){
77 cont.first.push_back(
met);
78 }
79
80 clock_t
begin = clock();
82 clock_t
end = clock();
83
84 cont.first.clear();
85
86 clock_t begin2 = clock();
88 clock_t end2 = clock();
89
90 cont.first.clear();
91
92 double stringTime =
double(end - begin );
93 double hashTime =
double(end2 - begin2);
94
95
96 stringComparisonTimes.push_back(stringTime);
97 hashComparisonTimes .push_back(hashTime);
98 }
99
100 std::cout <<
"Avg time to run testStringComparisonVersion : " <<
calcMean(stringComparisonTimes)/CLOCKS_PER_SEC << std::endl;
101 std::cout <<
"Avg time to run testHashComparisonVersion : " <<
calcMean(hashComparisonTimes )/CLOCKS_PER_SEC << std::endl;
102
103 return 0;
104 }
MissingET_v1 MissingET
Version control by type defintion.
static const std::map< int, std::string > metStringsMap
int testStringComparisonVersion(xAOD::MissingETContainer &cont)
int testHashComparisonVersion(xAOD::MissingETContainer &cont)
double calcMean(std::vector< double > ×)