-
-
Save ochafik/9ba170000e561a184c6fefe364da7b60 to your computer and use it in GitHub Desktop.
Performance benchmark script for Manifold
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
| #!/bin/bash | |
| # | |
| # Benchmarks Manifold tests between two branches | |
| # | |
| # Usage: | |
| # rm -fR master flatten | |
| # ./mani-branch-bench.sh master flatten | |
| # | |
| set -eu | |
| PYTHON_HOME=/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9 | |
| PYTHON_EXECUTABLE=$PYTHON_HOME/bin/python3 | |
| # PYTHON_EXECUTABLE=/usr/bin/python3 | |
| # PYTHON_EXECUTABLE=$(which python3) | |
| # PYTHON_EXECUTABLE=$(readlink -f $(which python3)) | |
| CMAKE_ARGS=( | |
| -DCMAKE_BUILD_TYPE=Release | |
| -DBUILD_SHARED_LIBS=ON | |
| -DMANIFOLD_PYBIND=ON | |
| -DPYBIND11_FINDPYTHON=ON | |
| -DPython_ROOT_DIR=$PYTHON_HOME | |
| -DPYTHON_EXECUTABLE:FILEPATH=$PYTHON_EXECUTABLE | |
| -DMANIFOLD_PAR=TBB | |
| ) | |
| BRANCHES=( "$@" ) | |
| BRANCHES_COMMASEP="$( export IFS=, ; echo "${BRANCHES[*]}" )" | |
| for branch in "${BRANCHES[@]}" ; do | |
| git checkout $branch | |
| ( \ | |
| mkdir -p $branch && \ | |
| cd $branch && \ | |
| cmake "${CMAKE_ARGS[@]}" .. && \ | |
| make -j \ | |
| ) | |
| done | |
| git checkout master | |
| hyperfine -L branch "$BRANCHES_COMMASEP" "PYTHONPATH=$PWD/{branch}/bindings/python:$PYTHONPATH $PYTHON_EXECUTABLE bindings/python/examples/run_all.py" | |
| hyperfine -L branch "$BRANCHES_COMMASEP" '{branch}/extras/perfTest' | |
| hyperfine -L branch "$BRANCHES_COMMASEP" '{branch}/test/manifold_test' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment