Make checkperf build master with the same options

This commit is contained in:
John Keiser 2020-04-18 14:13:34 -07:00
parent 9bf9fba2ec
commit fc50a36cc5
4 changed files with 37 additions and 7 deletions

5
.gitignore vendored
View File

@ -53,6 +53,7 @@ libs
objs
# Build outputs (TODO build to a subdir so we can exclude that instead)
/.simdjson-user-CMakeCache.txt
/allparserscheckfile
/allparsingcompetition
/basictests
@ -124,10 +125,10 @@ objs
/stringparsingcheck
/submodules
/ujdecode.o
/amalgamation_demo.cpp
/amalgamate_demo.cpp
/simdjson.cpp
/simdjson.h
/singleheader/amalgamation_demo
/singleheader/amalgamate_demo
/singleheader/demo
/tests/allparserscheckfile
/tests/basictests

View File

@ -17,6 +17,7 @@ set(PROJECT_VERSION_MINOR 3)
set(PROJECT_VERSION_PATCH 1)
set(SIMDJSON_LIB_VERSION "0.3.1" CACHE STRING "simdjson library version")
set(SIMDJSON_LIB_SOVERSION "1" CACHE STRING "simdjson library soversion")
set(SIMDJSON_GITHUB_REPOSITORY https://github.com/simdjson/simdjson)
if(MSVC)
option(SIMDJSON_BUILD_STATIC "Build a static library" ON) # turning it on disables the production of a dynamic library
@ -120,6 +121,23 @@ endfunction()
export_private_library(simdjson-flags)
#
# ${SIMDJSON_USER_CMAKECACHE} contains the *user-specified* simdjson options so you can call cmake on
# another branch or repository with the same options.
#
# Not supported on Windows at present, because the only thing that uses it is checkperf, which we
# don't run on Windows.
#
if (NOT MSVC)
set(SIMDJSON_USER_CMAKECACHE ${CMAKE_CURRENT_BINARY_DIR}/.simdjson-user-CMakeCache.txt)
add_custom_command(
OUTPUT ${SIMDJSON_USER_CMAKECACHE}
COMMAND bash -c "grep SIMDJSON_ ${PROJECT_BINARY_DIR}/CMakeCache.txt | grep -v SIMDJSON_LIB_ > ${SIMDJSON_USER_CMAKECACHE}"
VERBATIM # Makes it not do weird escaping with the command
)
add_custom_target(simdjson-user-cmakecache ALL DEPENDS ${SIMDJSON_USER_CMAKECACHE})
endif()
#
# Create the top level simdjson library (must be done at this level to use both src/ and include/
# directories) and tools

View File

@ -41,6 +41,7 @@ if (NOT MSVC)
CHECKPERF_REPOSITORY=https://github.com/simdjson/simdjson
CHECKPERF_BRANCH=master
CHECKPERF_DIR=${CMAKE_CURRENT_BINARY_DIR}/simdjson-master
CHECKPERF_CMAKECACHE=${SIMDJSON_USER_CMAKECACHE}
bash ${CMAKE_CURRENT_SOURCE_DIR}/checkperf.sh ${PROJECT_SOURCE_DIR}/jsonexamples/twitter.json)
set_property(TEST checkperf APPEND PROPERTY DEPENDS parse perfdiff)
endif()
set_property(TEST checkperf APPEND PROPERTY DEPENDS parse perfdiff ${SIMDJSON_USER_CMAKECACHE})
endif()

View File

@ -2,6 +2,8 @@
set -ex
set | grep CHECKPERF
if [ -z "$CHECKPERF_REPOSITORY" ]; then CHECKPERF_REPOSITORY=.; fi
# Arguments: perfdiff.sh <branch> <test json files>
@ -29,10 +31,18 @@ else
fi
echo "Building $CHECKPERF_DIR/parse ..."
make parse
if [ -n "$CHECKPERF_CMAKECACHE" ]; then
cp $CHECKPERF_CMAKECACHE $CHECKPERF_DIR/CMakeCache.txt
cmake -DSIMDJSON_GOOGLE_BENCHMARKS=OFF -DSIMDJSON_COMPETITION=OFF .
make parse
REFERENCE_PARSE=$CHECKPERF_DIR/benchmark/parse
else
make parse
REFERENCE_PARSE=$CHECKPERF_DIR/parse
fi
popd
# Run them and diff performance
echo "Running perfdiff:"
echo ./perfdiff \"./parse -t $CHECKPERF_ARGS\" \"$CHECKPERF_DIR/parse -t $CHECKPERF_ARGS\"
./perfdiff "./parse -t $CHECKPERF_ARGS" "$CHECKPERF_DIR/parse -t $CHECKPERF_ARGS"
echo ./perfdiff \"./parse -t $CHECKPERF_ARGS\" \"$REFERENCE_PARSE -t $CHECKPERF_ARGS\"
./perfdiff "./parse -t $CHECKPERF_ARGS" "$REFERENCE_PARSE -t $CHECKPERF_ARGS"