t/bench.cc

filter: Statementstmt 0.0% 0 / 16 Branchbran 0.0% 0 / 18 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 0.0% 0 / 34 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« blib/arch/Test/Catch.pm ↑ Summary Catch.xs »
1 #include <catch2/catch_test_macros.hpp>
2 #include <catch2/benchmark/catch_benchmark.hpp>
3  
4 0 TEST_CASE("bench", "[.]") {
5 0 ▶ BENCHMARK("hello1") {
Branch: 3 branches
BranchTrueFalseTotal
BENCHMARK("hello1") { 0 0 0
BENCHMARK("hello1") { 0 0 0
BENCHMARK("hello1") { 0 0 0
6 0 uint64_t r = 0;
7 0 ▶ for (int i = 0; i < 1000; ++i) {
Branch: 1 branch
BranchTrueFalseTotal
for (int i = 0; i < 1000; ++i) { 0 0 0
8 0 auto p = malloc(30000000);
9 0 r += (uint64_t)p;
10 0 free(p);
11 }
12 0 return r;
13 0 ▶ };
Branch: 1 branch
BranchTrueFalseTotal
}; 0 0 0
14 0 ▶ BENCHMARK("hello2") {
Branch: 3 branches
BranchTrueFalseTotal
BENCHMARK("hello2") { 0 0 0
BENCHMARK("hello2") { 0 0 0
BENCHMARK("hello2") { 0 0 0
15 uint64_t ret;
16 0 auto p = malloc(30000000);
17 0 ret = (uint64_t)p;
18 0 free(p);
19 0 return ret;
20 0 ▶ };
Branch: 1 branch
BranchTrueFalseTotal
}; 0 0 0
21 0 }
« blib/arch/Test/Catch.pm ↑ Summary Catch.xs »