fix: benchmark 规模缩减 + min_time 加 s 后缀(防 OOM/栈溢出)
CI / Build & Test (push) Failing after 28s
CI / Release Build (push) Failing after 34s

This commit is contained in:
茂之钳
2026-07-24 02:21:08 +00:00
parent 67eda39211
commit 29122daaa9
3 changed files with 10 additions and 10 deletions
+5 -5
View File
@@ -69,8 +69,8 @@ add_custom_target(vde_benchmarks
# ── CTest integration: register benchmarks with optional args ── # ── CTest integration: register benchmarks with optional args ──
# Run individual benchmarks via: ctest -R bench_ # Run individual benchmarks via: ctest -R bench_
enable_testing() enable_testing()
add_test(NAME bench_bvh COMMAND vde_bench_bvh --benchmark_min_time=0.01) add_test(NAME bench_bvh COMMAND vde_bench_bvh --benchmark_min_time=0.01s)
add_test(NAME bench_delaunay COMMAND vde_bench_delaunay --benchmark_min_time=0.01) add_test(NAME bench_delaunay COMMAND vde_bench_delaunay --benchmark_min_time=0.01s)
add_test(NAME bench_boolean COMMAND vde_bench_boolean --benchmark_min_time=0.01) add_test(NAME bench_boolean COMMAND vde_bench_boolean --benchmark_min_time=0.01s)
add_test(NAME bench_curves COMMAND vde_bench_curves --benchmark_min_time=0.01) add_test(NAME bench_curves COMMAND vde_bench_curves --benchmark_min_time=0.01s)
add_test(NAME bench_spatial COMMAND vde_bench_spatial --benchmark_min_time=0.01) add_test(NAME bench_spatial COMMAND vde_bench_spatial --benchmark_min_time=0.01s)
+1 -1
View File
@@ -58,7 +58,7 @@ static void BVH_Build(benchmark::State& state) {
} }
state.SetItemsProcessed(state.iterations() * state.range(0)); state.SetItemsProcessed(state.iterations() * state.range(0));
} }
BENCHMARK(BVH_Build)->Arg(1000)->Arg(10000)->Arg(100000); BENCHMARK(BVH_Build)->Arg(1000)->Arg(5000)->Arg(10000);
// ── BVH Ray Query ───────────────────────────────────────────────────── // ── BVH Ray Query ─────────────────────────────────────────────────────
+4 -4
View File
@@ -45,7 +45,7 @@ static void RTree_Build(benchmark::State& state) {
} }
state.SetItemsProcessed(state.iterations() * state.range(0)); state.SetItemsProcessed(state.iterations() * state.range(0));
} }
BENCHMARK(RTree_Build)->Arg(1000)->Arg(10000)->Arg(100000); BENCHMARK(RTree_Build)->Arg(1000)->Arg(10000)->Arg(50000);
class RTreeFixture : public benchmark::Fixture { class RTreeFixture : public benchmark::Fixture {
public: public:
@@ -71,7 +71,7 @@ BENCHMARK_DEFINE_F(RTreeFixture, RTree_kNN)(benchmark::State& state) {
benchmark::DoNotOptimize(total); benchmark::DoNotOptimize(total);
state.SetItemsProcessed(state.iterations() * queries.size()); state.SetItemsProcessed(state.iterations() * queries.size());
} }
BENCHMARK_REGISTER_F(RTreeFixture, RTree_kNN)->Arg(1000)->Arg(10000)->Arg(100000); BENCHMARK_REGISTER_F(RTreeFixture, RTree_kNN)->Arg(1000)->Arg(10000)->Arg(50000);
// ── KD-Tree ────────────────────────────────────────────────────────── // ── KD-Tree ──────────────────────────────────────────────────────────
@@ -84,7 +84,7 @@ static void KDTree_Build(benchmark::State& state) {
} }
state.SetItemsProcessed(state.iterations() * state.range(0)); state.SetItemsProcessed(state.iterations() * state.range(0));
} }
BENCHMARK(KDTree_Build)->Arg(1000)->Arg(10000)->Arg(100000); BENCHMARK(KDTree_Build)->Arg(1000)->Arg(10000)->Arg(50000);
class KDTreeFixture : public benchmark::Fixture { class KDTreeFixture : public benchmark::Fixture {
public: public:
@@ -110,4 +110,4 @@ BENCHMARK_DEFINE_F(KDTreeFixture, KDTree_kNN)(benchmark::State& state) {
benchmark::DoNotOptimize(total); benchmark::DoNotOptimize(total);
state.SetItemsProcessed(state.iterations() * queries.size()); state.SetItemsProcessed(state.iterations() * queries.size());
} }
BENCHMARK_REGISTER_F(KDTreeFixture, KDTree_kNN)->Arg(1000)->Arg(10000)->Arg(100000); BENCHMARK_REGISTER_F(KDTreeFixture, KDTree_kNN)->Arg(1000)->Arg(10000)->Arg(50000);