test: improve precision in benchmarking operations
This commit is contained in:
@@ -146,27 +146,27 @@ TEST_CASE("Test point creation, query and deletion behaviour", "[point]") {
|
|||||||
TEST_CASE("Benchmark point operations") {
|
TEST_CASE("Benchmark point operations") {
|
||||||
SECTION("make_point performance") {
|
SECTION("make_point performance") {
|
||||||
point_shape_t* p = nullptr;
|
point_shape_t* p = nullptr;
|
||||||
BENCHMARK("create point") {
|
BENCHMARK("Create point") {
|
||||||
return p = make_point(1.0, 2.0, 3.0);
|
return p = make_point(1.0, 2.0, 3.0);
|
||||||
};
|
};
|
||||||
delete_point(p);
|
delete_point(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("coord_point performance") {
|
SECTION("coord_point performance") {
|
||||||
point_shape_t* point = make_point(1.0, 2.0, 3.0);
|
point_shape_t* p = make_point(1.0, 2.0, 3.0);
|
||||||
double x, y, z;
|
double x, y, z;
|
||||||
|
|
||||||
BENCHMARK("extract coordinates") {
|
BENCHMARK("Extract coordinates") {
|
||||||
coord_point(point, &x, &y, &z);
|
coord_point(p, &x, &y, &z);
|
||||||
};
|
};
|
||||||
delete_point(point);
|
delete_point(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("delete_point performance") {
|
SECTION("delete_point performance") {
|
||||||
BENCHMARK("create and delete point") {
|
point_shape_t* p = make_point(1.0, 2.0, 3.0);
|
||||||
point_shape_t* point = make_point(1.0, 2.0, 3.0);
|
BENCHMARK("Delete point") {
|
||||||
delete_point(point);
|
delete_point(p);
|
||||||
return point;
|
return p;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user