Repository navigation
Add a benchmark script to compare speed and output between builds - #114
Open
clintmorris229 wants to merge 1 commit into
Open
clintmorris229 wants to merge 1 commit into
clintmorris229 wants to merge 1 commit into
Conversation
run_benchmark.py runs the main executable on the example meshes with a fixed seed and reports the median time, how much the run times vary, the number of hulls and a hash of the output for each mesh. Given a second executable, it alternates runs of the two and reports the speedup and whether the outputs are identical.
clintmorris229
marked this pull request as ready for review
November 24, 2026 16:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds
run_benchmark.py, a small script for measuring CoACD's speed and checking that a change doesn't alter its results. It's meant as a first step before a few small performance PRs, so each one can show its numbers the same way.It runs the
mainexecutable on the example meshes with a fixed seed (0 by default, sincemainotherwise seeds from the clock). For each mesh it reports the median wall time over several runs, how much the run times vary, the number of hulls and a SHA-256 of the output OBJ. With--baselineand--candidateit alternates runs of the two builds, so changes in machine load affect both alike. It prints the speedup and whether the outputs are identical, and exits with an error if any differ. It uses only the Python standard library and doesn't change any C++ or CMake files. A short section in the README explains how to use it.Comparing
mainwith a second copy of itself, 3 runs each on an otherwise idle machine (Linux, Release, OpenMP), shows how much noise there is:So on a quiet machine, speedups above about 1% are measurable. The
+-%columns give the variation for each comparison. The identity check compares the OBJ files thatmainwrites, which store coordinates with 6 significant digits.