Last active
June 25, 2019 16:36
-
-
Save alalek/2d4f4f40927e2d180f298ae42392540d to your computer and use it in GitHub Desktop.
OpenCV Threading performance measurement
This file contains 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 -e | |
OPENCV_SRC_DIR=${OPENCV_SRC_DIR:-../opencv} | |
if [[ ! -d "${OPENCV_SRC_DIR}" ]]; then | |
echo "ERROR: Specify OPENCV_SRC_DIR (${OPENCV_SRC_DIR})" | |
exit 1 | |
fi | |
PREFIX=${1:-../perf/dnn/} | |
PREFIX_1=$2 | |
PREFIX_2=$3 | |
set -x | |
if [[ -n "${PREFIX_2}" ]]; then | |
python ${OPENCV_SRC_DIR}/modules/ts/misc/summary.py ${PREFIX}${PREFIX_2}{1,2,4,8}.xml | |
python ${OPENCV_SRC_DIR}/modules/ts/misc/summary.py ${PREFIX}{${PREFIX_2}1,${PREFIX_1}1}.xml | |
python ${OPENCV_SRC_DIR}/modules/ts/misc/summary.py ${PREFIX}{${PREFIX_2}4,${PREFIX_1}4}.xml | |
python ${OPENCV_SRC_DIR}/modules/ts/misc/summary.py ${PREFIX}{${PREFIX_2}8,${PREFIX_1}8}.xml | |
python ${OPENCV_SRC_DIR}/modules/ts/misc/summary.py --progress ${PREFIX}${PREFIX_2}{1,2,4,8}.xml | |
fi | |
python ${OPENCV_SRC_DIR}/modules/ts/misc/summary.py --progress ${PREFIX}${PREFIX_1}{1,2,4,8}.xml | |
python ${OPENCV_SRC_DIR}/modules/ts/misc/summary.py ${PREFIX}${PREFIX_1}{1,2,4,8}.xml |
This file contains 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
PREFIX=${1:-../perf/dnn/} | |
TEST_BINARY=${TEST_BINARY:-./bin/opencv_perf_dnn} | |
TEST_FILTER=${TEST_FILTER:-*Net*} | |
${TEST_BINARY} --gtest_filter=${TEST_FILTER} --perf_min_samples=20 --perf_force_samples=20 --gtest_output=xml:${PREFIX}1.xml --perf_threads=1 | |
${TEST_BINARY} --gtest_filter=${TEST_FILTER} --perf_min_samples=20 --perf_force_samples=20 --gtest_output=xml:${PREFIX}2.xml --perf_threads=2 | |
${TEST_BINARY} --gtest_filter=${TEST_FILTER} --perf_min_samples=20 --perf_force_samples=20 --gtest_output=xml:${PREFIX}4.xml --perf_threads=4 | |
${TEST_BINARY} --gtest_filter=${TEST_FILTER} --perf_min_samples=20 --perf_force_samples=20 --gtest_output=xml:${PREFIX}8.xml --perf_threads=8 |
This file contains 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
mkdir -p ../perf/dnn/base | |
mkdir -p ../perf/dnn/path | |
# build base version (make -j5 opencv_perf_dnn) | |
../run_threading_perf.sh ../perf/dnn/base/ | |
# build patched version | |
../run_threading_perf.sh ../perf/dnn/patch/ | |
# show reports | |
../report_perf_threading.sh ../perf/dnn patch/ base/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment