66 for (
unsigned int j = 0; j < 5; ++j ) {
67 dude[j] = 3.15*543/230.235;
74 for (
unsigned int j = 0; j < 5; ++j ) {
75 dude[j] = 3.15*543/230.235;
98 times[0] = stopwatch.split();
100 times[1] = stopwatch.split();
102 times[2] = stopwatch.split();
104 times[3] = stopwatch.split();
106 times[4] = stopwatch.split();
108 times[5] = stopwatch.split();
113 times[6] = stopwatch.split();
117 times[7] = stopwatch.split();
121 times[8] = stopwatch.split();
126 times[0] = stopwatch.split();
128 times[1] = stopwatch.split();
130 times[2] = stopwatch.split();
132 times[3] = stopwatch.split();
134 times[4] = stopwatch.split();
136 times[5] = stopwatch.split();
142 times[6] = stopwatch.split();
146 times[7] = stopwatch.split();
150 times[8] = stopwatch.split();
152 std::cout << std::endl;
153 std::cout <<
"***********************************************************" << std::endl;
154 std::cout <<
" Performance comparison ecl exceptions" << std::endl;
155 std::cout <<
"***********************************************************" << std::endl;
156 std::cout << std::endl;
158 std::cout <<
"Simple Candidate Function " <<
" Time: " << times[0] << std::endl;
159 std::cout <<
" Undeclared exception " <<
" Time: " << times[1] << std::endl;
160 std::cout <<
" Unused exception " <<
" Time: " << times[2] << std::endl;
161 std::cout <<
" Unused exception w/ string " <<
" Time: " << times[3] << std::endl;
162 std::cout << std::endl;
163 std::cout <<
"Complex Candidate Function " <<
" Time: " << times[4] << std::endl;
164 std::cout <<
" Unused exception w/ string " <<
" Time: " << times[5] << std::endl;
165 std::cout << std::endl;
166 std::cout <<
"Try Catch Blocks " << std::endl;
167 std::cout <<
" Uncaught exceptions " <<
" Time: " << times[6] << std::endl;
168 std::cout <<
" Caught exception " <<
" Time: " << times[7] << std::endl;
169 std::cout <<
" Caught exception w/string " <<
" Time: " << times[8] << std::endl;
171 std::cout << std::endl;
172 std::cout <<
"***********************************************************" << std::endl;
173 std::cout <<
" Conclusions" << std::endl;
174 std::cout <<
"***********************************************************" << std::endl;
175 std::cout << std::endl;
177 std::cout <<
"The following conclusions are after testing on a dual core." << std::endl;
178 std::cout << std::endl;
179 std::cout <<
" - In simple functions, unused ecl exceptions < 50ns." << std::endl;
180 std::cout <<
" - String messages don't effect the cost of unused ecl exceptions." << std::endl;
181 std::cout <<
" - Try-catch blocks have negligible cost." << std::endl;
182 std::cout <<
" - String messages do impact caught messages ~1us." << std::endl;
183 std::cout << std::endl;