Skip to content

Free, open-source 3D sculpting for Linux, macOS and Windows: dense meshes, remeshing, painting, built-in AI (image/text to 3D), Send to Unreal, game-ready LODs, Gaussian splats and OpenUSD.

Benchmark: Smooth and Move at large radius, and --bench-brushes to run only some rows

islandmed28fb707f7ec2
diff --git a/docs/guide/performance.md b/docs/guide/performance.md
index 8a51dfe0..03e03e3f 100644
--- a/docs/guide/performance.md
+++ b/docs/guide/performance.md
@@ -68,6 +68,7 @@ stepping subdivision levels, saving and opening a project, and turning the view,
|---|---|
| `--bench-sizes 4,16,32` | The sizes, in millions of triangles |
| `--bench-dabs 40` | Dabs per test stroke |
+| `--bench-brushes large` | Only the brushes whose name contains the text (here the large-radius ones) |
| `--bench-no-project` | Skip saving and opening the project (which needs twice the memory) |
| `--bench-out report.md` | Write the report to a file |
diff --git a/docs/performance.md b/docs/performance.md
index 3a37c017..cf65d6ca 100644
--- a/docs/performance.md
+++ b/docs/performance.md
@@ -4,7 +4,7 @@ Measurements for the v0.5 performance work ("Performance at 20-100M polygons, mu
Every number here comes from the benchmark built into SculptForge, so anyone can reproduce it:
```
-sculptforge --bench [--bench-sizes 4,16,32] [--bench-dabs 40] [--bench-no-project] [--bench-out report.md]
+sculptforge --bench [--bench-sizes 4,16,32] [--bench-dabs 40] [--bench-brushes TEXT] [--bench-no-project] [--bench-out report.md]
sculptforge-cli --bench ... # the same without the GPU (CI, servers)
```
diff --git a/src/app/main.cpp b/src/app/main.cpp
index 876babc4..b5167763 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
@@ -39,6 +39,7 @@ void usage() {
" --bench Run the performance benchmark (with GPU upload and orbit timings) and exit\n"
" --bench-sizes 4,16,32 Benchmark sizes in millions of triangles\n"
" --bench-dabs N Dabs per benchmark stroke (default 40)\n"
+ " --bench-brushes TEXT Only the benchmark brushes whose name contains TEXT (e.g. large)\n"
" --bench-no-project Skip the project save / open (it needs twice the memory)\n"
" --bench-out FILE Write the benchmark report (Markdown) to FILE");
}
diff --git a/src/cli/main.cpp b/src/cli/main.cpp
index ba7c8aa3..992aba43 100644
--- a/src/cli/main.cpp
+++ b/src/cli/main.cpp
@@ -34,6 +34,7 @@ void usage() {
" --bench Run the performance benchmark (CPU side; the app's --bench adds the GPU)\n"
" --bench-sizes 4,16,32 Benchmark sizes in millions of triangles\n"
" --bench-dabs N Dabs per benchmark stroke (default 40)\n"
+ " --bench-brushes TEXT Only the benchmark brushes whose name contains TEXT (e.g. large)\n"
" --bench-no-project Skip the project save / open (it needs twice the memory)\n"
" --bench-out FILE Write the benchmark report (Markdown) to FILE\n"
" -h, --help Show this help\n"
diff --git a/src/core/Benchmark.cpp b/src/core/Benchmark.cpp
index b5d7892f..6aef8cd3 100644
--- a/src/core/Benchmark.cpp
+++ b/src/core/Benchmark.cpp
@@ -222,6 +222,8 @@ bool parseBenchArg(int argc, char** argv, int& i, BenchCommandLine& cl) {
if (const double v = std::atof(item.c_str()); v > 0.0) cl.options.sizesMillions.push_back(v);
} else if (a == "--bench-dabs") {
cl.options.dabsPerStroke = std::max(1, std::atoi(next().c_str()));
+ } else if (a == "--bench-brushes") {
+ cl.options.brushFilter = next();
} else if (a == "--bench-no-project") {
cl.options.projectRoundTrip = false;
} else if (a == "--bench-out") {
@@ -275,10 +277,12 @@ std::string runBenchmark(const BenchOptions& o, const BenchGpu* gpu) {
{"Clay", Kind::Brush, BrushType::Clay},
{"ClayBuildup", Kind::Brush, BrushType::ClayBuildup},
{"Smooth", Kind::Brush, BrushType::Smooth},
+ {"Smooth (large, r 0.4)", Kind::Brush, BrushType::Smooth, 0.4f},
{"Inflate", Kind::Brush, BrushType::Inflate},
{"DamStandard", Kind::Brush, BrushType::DamStandard},
{"Layer", Kind::Brush, BrushType::Layer},
{"Move", Kind::Move, BrushType::Move},
+ {"Move (large, r 0.4)", Kind::Move, BrushType::Move, 0.4f},
{"Recipe (pattern)", Kind::Recipe},
{"Mask", Kind::Mask},
{"Paint", Kind::Paint},
@@ -323,6 +327,7 @@ std::string runBenchmark(const BenchOptions& o, const BenchGpu* gpu) {
<< "**dab total** | stroke end (undo record) | undo | redo | undo step |\n";
md << "|---|---:|---:|---:|---:|---:|---:|" << (gpu ? "---:|" : "") << "---:|---:|---:|---:|---:|\n";
for (const BenchBrush& b : brushes) {
+ if (!o.brushFilter.empty() && b.name.find(o.brushFilter) == std::string::npos) continue;
log(" " + b.name);
const StrokeStats s = runStroke(doc, b, o.dabsPerStroke, gpu, order);
const double d = std::max(s.dabs, 1);
diff --git a/src/core/Benchmark.h b/src/core/Benchmark.h
index c607ad2c..12ef8ed0 100644
--- a/src/core/Benchmark.h
+++ b/src/core/Benchmark.h
@@ -35,13 +35,14 @@ struct BenchOptions {
int dabsPerStroke = 40;
std::string projectDir; // where the project round trip writes (default: the system temp folder)
bool projectRoundTrip = true;
+ std::string brushFilter; // only the brushes whose row name contains this (empty = all)
std::function<void(const std::string&)> log; // progress lines (optional)
std::function<void(const std::string&)> partial; // the report so far, after each size (optional)
};
// Command-line options shared by sculptforge-cli and the app: --bench, --bench-sizes 4,16,32 (millions of
// triangles), --bench-dabs N, --bench-no-project (skip saving / opening, which needs twice the memory),
-// --bench-out FILE. parseBenchArg returns true when argv[i] was one of them
+// --bench-brushes TEXT (only the rows whose name contains TEXT), --bench-out FILE. parseBenchArg returns true when argv[i] was one of them
// (advancing i past its value).
struct BenchCommandLine {
bool run = false;