Commit 0c093941 authored by Hans-Christian Ebke's avatar Hans-Christian Ebke
Browse files

Added two more benchmarks.

parent c9d2e4f1
Pipeline #54 passed with stage
......@@ -42,3 +42,33 @@ static void ASSEMBLE(BMPREFIX, Vec3d_add_compare)(benchmark::State& state) {
}
MYBENCHMARK (ASSEMBLE(BMPREFIX, Vec3d_add_compare));
static void ASSEMBLE(BMPREFIX, Vec3d_cross_product)(benchmark::State& state) {
OpenMesh::Vec3d v1(0, 0, 0);
OpenMesh::Vec3d v2(1000, 1000, 1000);
while (state.KeepRunning()) {
v1 += OpenMesh::Vec3d(1.1, 1.2, 1.3);
v2 -= OpenMesh::Vec3d(1.1, 1.2, 1.3);
if ((v1 % v2) == (v2 % v1)) {
v1 -= v2;
v2 += v1;
}
}
}
MYBENCHMARK (ASSEMBLE(BMPREFIX, Vec3d_cross_product));
static void ASSEMBLE(BMPREFIX, Vec3d_scalar_product)(benchmark::State& state) {
OpenMesh::Vec3d v1(0, 0, 0);
OpenMesh::Vec3d v2(1000, 1000, 1000);
while (state.KeepRunning()) {
v1 += OpenMesh::Vec3d(1.1, 1.2, 1.3);
v2 -= OpenMesh::Vec3d(1.1, 1.2, 1.3);
if ((v1 | v2) > 0) {
v1 -= v2;
v2 += v1;
}
}
}
MYBENCHMARK (ASSEMBLE(BMPREFIX, Vec3d_scalar_product));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment