PDA

View Full Version : ClanLib Benchmarking Utility



rombust
11-08-2013, 11:12 PM
I have created a very simple project , which is proving quite interesting.

It performs benchmarks on some basic c++ programming functions.

It can be found on ClanLib 3.0 GIT under Tests/Core/Benchmark. It writes the output to "results.txt" at the end of each cycle.

Using Visual Studio 2010 (Release Build)
ClanLib Benchmark Utility Results

Process Priority: HIGH
Simulation Test Run Length = 1.99 seconds
Using 783688361 Iterations

Test Number) Time : Function
1) 1.0 : {}
2) 1.2 : {i++;}
3) 1.2 : {float_value = (float) int_value;}
4) 2.1 : {int_value = (int) float_value;}
5) 1.2 : {double_value = (double) int_value;}
6) 2.1 : {int_value = (int) double_value;}
7) 1.4 : {int_value += int_sixteen + int_seven;}
8) 1.4 : {int_value += int_sixteen * int_seven;}
9) 1.7 : {int_value += int_sixteen / int_seven;}
10) 1.4 : {float_value += float_sixteen + float_seven;}
11) 1.4 : {float_value += float_sixteen * float_seven;}
12) 2.5 : {float_value += float_sixteen / float_seven;}
13) 1.6 : {double_value += double_sixteen + double_seven;}
14) 1.6 : {double_value += double_sixteen * double_seven;}
15) 2.5 : {double_value += double_sixteen / double_seven;}
16) 6.1 : {string = std::string();}
17) 1.4 : {char_value = string[0]}
18) 1.4 : {char_value = string.cstr()[0]}
19) 1.2 : {char_value = char_array[0];}
20) 9.4 : {for (int cnt=0; cnt<sixteen; cnt++) char_value += string2[cnt];}
21) 5.4 : {for (int cnt=0; cnt<sixteen; cnt++) char_value += char_array[cnt];}
22) 5.4 : {string = "123456789012345";}
23) 10.9 : {string = std::string("123456789012345");}
24) 5.4 : {string.assign("123456789012345");}
25) 7.8 : {string = "123456789012345678901234567890123456789";}
26) 148.4 : {string = std::string("123456789012345678901234567890123456789");}
27) 7.8 : {string.assign("123456789012345678901234567890123456789");}
28) 1.4 : {int_value += *int_ptr;}
29) 1.4 : {int_value += *int_shared_ptr;}
30) 7.8 : {for (size_t cnt=0; cnt<std_vector_int_size16.size(); cnt++) { int_value += std_vector_int_size16[cnt]; }}
31) 5.3 : {for (size_t cnt=0, max = std_vector_int_size16.size(); cnt<max; cnt++) { int_value += std_vector_int_size16[cnt]; }}
32) 5.5 : {for (auto it = std_vector_int_size16.begin(); it != std_vector_int_size16.end(); ++it) { int_value += *it; }}
33) 5.5 : {for (auto it = std_vector_int_size16.begin(); it != std_vector_int_size16.end(); it++) { int_value += *it; }}
34) 1.3 : {utils.function();} : void function() {}
35) 1.5 : {int_value = utils.function();} : int function() {return five;}
36) 12.8 : {string = utils.function();} : std::string function() {return string_hello_world;}
37) 6.1 : {string = utils.function();} : std::string &function() {return string_hello_world;}
38) 5.9 : {utils.function(string);} : void function(std::string &out_string) {out_string = string_hello_world;}