mirror of
https://github.com/facebook/zstd.git
synced 2025-10-18 00:03:50 -04:00
Merge pull request #557 from inikep/dev11
travis.yml: remove tests that overlap with Circle CI
This commit is contained in:
commit
e37d9e2d8f
97
.travis.yml
97
.travis.yml
@ -8,21 +8,6 @@ matrix:
|
|||||||
|
|
||||||
|
|
||||||
# Container-based Ubuntu 12.04 LTS Server Edition 64 bit (doesn't support 32-bit includes)
|
# Container-based Ubuntu 12.04 LTS Server Edition 64 bit (doesn't support 32-bit includes)
|
||||||
- env: Ubu=12.04cont Cmd="make zlibwrapper && make clean && make -C tests test-symbols && make clean && make -C tests test-zstd-nolegacy && make clean && make cmaketest && make clean && make -C contrib/pzstd googletest pzstd tests check && make -C contrib/pzstd clean"
|
|
||||||
os: linux
|
|
||||||
sudo: false
|
|
||||||
language: cpp
|
|
||||||
install:
|
|
||||||
- export CXX="g++-4.8" CC="gcc-4.8"
|
|
||||||
- export TESTFLAGS='--gtest_filter=-*ExtremelyLarge*'
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
packages:
|
|
||||||
- gcc-4.8
|
|
||||||
- g++-4.8
|
|
||||||
|
|
||||||
- env: Ubu=12.04cont Cmd="make usan"
|
- env: Ubu=12.04cont Cmd="make usan"
|
||||||
os: linux
|
os: linux
|
||||||
sudo: false
|
sudo: false
|
||||||
@ -32,22 +17,21 @@ matrix:
|
|||||||
sudo: false
|
sudo: false
|
||||||
|
|
||||||
|
|
||||||
# Standard Ubuntu 12.04 LTS Server Edition 64 bit
|
- env: Ubu=14.04 Cmd='make -C tests test32 CC=clang-4.0 MOREFLAGS="-g -fsanitize=address"'
|
||||||
- env: Ubu=12.04 Cmd="make -C programs zstd-small zstd-decompress zstd-compress && make -C programs clean && make -C tests versionsTest test-longmatch"
|
|
||||||
os: linux
|
|
||||||
sudo: required
|
|
||||||
|
|
||||||
- env: Ubu=12.04 Cmd="make asan32"
|
|
||||||
os: linux
|
os: linux
|
||||||
|
dist: trusty
|
||||||
sudo: required
|
sudo: required
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
- ubuntu-toolchain-r-test
|
- llvm-toolchain-trusty-4.0
|
||||||
packages:
|
packages:
|
||||||
- libc6-dev-i386
|
- libc6-dev-i386
|
||||||
- gcc-multilib
|
- gcc-multilib
|
||||||
|
- clang-4.0
|
||||||
|
|
||||||
|
|
||||||
|
# Standard Ubuntu 12.04 LTS Server Edition 64 bit
|
||||||
- env: Ubu=12.04 Cmd='cd contrib/pzstd && make googletest && make tsan && make check && make clean && make asan && make check && make clean && cd ../..'
|
- env: Ubu=12.04 Cmd='cd contrib/pzstd && make googletest && make tsan && make check && make clean && make asan && make check && make clean && cd ../..'
|
||||||
os: linux
|
os: linux
|
||||||
sudo: required
|
sudo: required
|
||||||
@ -65,6 +49,23 @@ matrix:
|
|||||||
|
|
||||||
|
|
||||||
# Ubuntu 14.04 LTS Server Edition 64 bit
|
# Ubuntu 14.04 LTS Server Edition 64 bit
|
||||||
|
- env: Ubu=14.04 Cmd="make -C contrib/pzstd googletest pzstd tests check && make -C contrib/pzstd clean
|
||||||
|
&& make -C contrib/pzstd googletest32 && make -C contrib/pzstd all32 && make -C contrib/pzstd check && make -C contrib/pzstd clean"
|
||||||
|
os: linux
|
||||||
|
dist: trusty
|
||||||
|
sudo: required
|
||||||
|
install:
|
||||||
|
- export CXX="g++-4.8" CC="gcc-4.8"
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- libc6-dev-i386
|
||||||
|
- g++-multilib
|
||||||
|
- gcc-4.8
|
||||||
|
- gcc-4.8-multilib
|
||||||
|
- g++-4.8
|
||||||
|
- g++-4.8-multilib
|
||||||
|
|
||||||
- env: Ubu=14.04 Cmd="make armtest"
|
- env: Ubu=14.04 Cmd="make armtest"
|
||||||
dist: trusty
|
dist: trusty
|
||||||
sudo: required
|
sudo: required
|
||||||
@ -107,7 +108,9 @@ matrix:
|
|||||||
- qemu-user-static
|
- qemu-user-static
|
||||||
- gcc-powerpc-linux-gnu
|
- gcc-powerpc-linux-gnu
|
||||||
|
|
||||||
- env: Ubu=14.04 Cmd='make -C lib all && CFLAGS="-O1 -g" make -C zlibWrapper valgrindTest && make -C tests valgrindTest'
|
|
||||||
|
# other feature branches => short tests
|
||||||
|
- env: Ubu=14.04 Cmd='make lib && CFLAGS="-O1 -g" make -C zlibWrapper valgrindTest && make -C tests valgrindTest'
|
||||||
os: linux
|
os: linux
|
||||||
dist: trusty
|
dist: trusty
|
||||||
sudo: required
|
sudo: required
|
||||||
@ -116,14 +119,7 @@ matrix:
|
|||||||
packages:
|
packages:
|
||||||
- valgrind
|
- valgrind
|
||||||
|
|
||||||
|
- env: Ubu=14.04 Cmd="make zlibwrapper && make clean && make -C tests test-zstd-nolegacy && make clean && make -C tests test32 versionsTest"
|
||||||
|
|
||||||
# other feature branches => short tests
|
|
||||||
- env: Ubu=12.04cont Cmd="make test && make clean && make travis-install"
|
|
||||||
os: linux
|
|
||||||
sudo: false
|
|
||||||
|
|
||||||
- env: Ubu=14.04 Cmd="make -C tests test32"
|
|
||||||
os: linux
|
os: linux
|
||||||
dist: trusty
|
dist: trusty
|
||||||
sudo: required
|
sudo: required
|
||||||
@ -133,49 +129,18 @@ matrix:
|
|||||||
- libc6-dev-i386
|
- libc6-dev-i386
|
||||||
- gcc-multilib
|
- gcc-multilib
|
||||||
|
|
||||||
- env: Ubu=14.04 Cmd="make gpptest && make clean && make gnu90test && make clean
|
|
||||||
&& make c99test && make clean && make gnu99test && make clean
|
|
||||||
&& make clangtest && make clean && make -C contrib/pzstd googletest32
|
|
||||||
&& make -C contrib/pzstd all32 && make -C contrib/pzstd check && make -C contrib/pzstd clean"
|
|
||||||
os: linux
|
|
||||||
dist: trusty
|
|
||||||
sudo: required
|
|
||||||
install:
|
|
||||||
- export CXX="g++-4.8" CC="gcc-4.8"
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- libc6-dev-i386
|
|
||||||
- g++-multilib
|
|
||||||
- gcc-4.8
|
|
||||||
- gcc-4.8-multilib
|
|
||||||
- g++-4.8
|
|
||||||
- g++-4.8-multilib
|
|
||||||
|
|
||||||
- env: Ubu=14.04 Cmd="make gcc5test && make clean && make gcc6test && make clean && make -C tests dll"
|
|
||||||
os: linux
|
|
||||||
dist: trusty
|
|
||||||
sudo: required
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
packages:
|
|
||||||
- gcc-multilib
|
|
||||||
- gcc-5
|
|
||||||
- gcc-5-multilib
|
|
||||||
- gcc-6
|
|
||||||
- gcc-6-multilib
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- JOB_NUMBER=$(echo $TRAVIS_JOB_NUMBER | sed -e 's:[0-9][0-9]*\.\(.*\):\1:')
|
- JOB_NUMBER=$(echo $TRAVIS_JOB_NUMBER | sed -e 's:[0-9][0-9]*\.\(.*\):\1:')
|
||||||
|
|
||||||
# cron & master => long tests, as this is the final step towards a Release
|
# cron & master => long tests, as this is the final step towards a Release
|
||||||
# dev => normal tests; other feature branches => short tests (number > 11)
|
# dev => normal tests
|
||||||
|
# other feature branches => short tests (number > 10)
|
||||||
- if [ "$TRAVIS_EVENT_TYPE" = "cron" ] || [ "$TRAVIS_BRANCH" = "master" ]; then
|
- if [ "$TRAVIS_EVENT_TYPE" = "cron" ] || [ "$TRAVIS_BRANCH" = "master" ]; then
|
||||||
FUZZERTEST=-T10mn sh -c "$Cmd" || travis_terminate 1;
|
FUZZERTEST=-T10mn sh -c "$Cmd" || travis_terminate 1;
|
||||||
else
|
else
|
||||||
if [ "$TRAVIS_PULL_REQUEST" = "true" ] || [ $JOB_NUMBER -gt 11 ] || [ "$TRAVIS_BRANCH" = "dev" ]; then
|
if [ "$TRAVIS_PULL_REQUEST" = "true" ] || [ $JOB_NUMBER -gt 10 ] || [ "$TRAVIS_BRANCH" = "dev" ]; then
|
||||||
sh -c "$Cmd" || travis_terminate 1;
|
sh -c "$Cmd" || travis_terminate 1;
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -169,7 +169,7 @@ static int BMK_benchMem(const void* srcBuffer, size_t srcSize,
|
|||||||
size_t cSize = 0;
|
size_t cSize = 0;
|
||||||
double ratio = 0.;
|
double ratio = 0.;
|
||||||
U32 nbBlocks;
|
U32 nbBlocks;
|
||||||
UTIL_time_t ticksPerSecond;
|
UTIL_freq_t ticksPerSecond;
|
||||||
|
|
||||||
/* checks */
|
/* checks */
|
||||||
if (!compressedBuffer || !resultBuffer || !blockTable || !ctx || !dctx)
|
if (!compressedBuffer || !resultBuffer || !blockTable || !ctx || !dctx)
|
||||||
@ -230,7 +230,7 @@ static int BMK_benchMem(const void* srcBuffer, size_t srcSize,
|
|||||||
/* Bench */
|
/* Bench */
|
||||||
{ U64 fastestC = (U64)(-1LL), fastestD = (U64)(-1LL);
|
{ U64 fastestC = (U64)(-1LL), fastestD = (U64)(-1LL);
|
||||||
U64 const crcOrig = g_decodeOnly ? 0 : XXH64(srcBuffer, srcSize, 0);
|
U64 const crcOrig = g_decodeOnly ? 0 : XXH64(srcBuffer, srcSize, 0);
|
||||||
UTIL_time_t coolTime, coolTick;
|
UTIL_time_t coolTime;
|
||||||
U64 const maxTime = (g_nbSeconds * TIMELOOP_MICROSEC) + 1;
|
U64 const maxTime = (g_nbSeconds * TIMELOOP_MICROSEC) + 1;
|
||||||
U64 totalCTime=0, totalDTime=0;
|
U64 totalCTime=0, totalDTime=0;
|
||||||
U32 cCompleted=g_decodeOnly, dCompleted=0;
|
U32 cCompleted=g_decodeOnly, dCompleted=0;
|
||||||
@ -238,27 +238,25 @@ static int BMK_benchMem(const void* srcBuffer, size_t srcSize,
|
|||||||
const char* const marks[NB_MARKS] = { " |", " /", " =", "\\" };
|
const char* const marks[NB_MARKS] = { " |", " /", " =", "\\" };
|
||||||
U32 markNb = 0;
|
U32 markNb = 0;
|
||||||
|
|
||||||
UTIL_initTimer(&coolTick);
|
|
||||||
UTIL_getTime(&coolTime);
|
UTIL_getTime(&coolTime);
|
||||||
DISPLAYLEVEL(2, "\r%79s\r", "");
|
DISPLAYLEVEL(2, "\r%79s\r", "");
|
||||||
while (!cCompleted || !dCompleted) {
|
while (!cCompleted || !dCompleted) {
|
||||||
|
|
||||||
/* overheat protection */
|
/* overheat protection */
|
||||||
if (UTIL_clockSpanMicro(coolTime, coolTick) > ACTIVEPERIOD_MICROSEC) {
|
if (UTIL_clockSpanMicro(coolTime, ticksPerSecond) > ACTIVEPERIOD_MICROSEC) {
|
||||||
DISPLAYLEVEL(2, "\rcooling down ... \r");
|
DISPLAYLEVEL(2, "\rcooling down ... \r");
|
||||||
UTIL_sleep(COOLPERIOD_SEC);
|
UTIL_sleep(COOLPERIOD_SEC);
|
||||||
UTIL_getTime(&coolTime);
|
UTIL_getTime(&coolTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_decodeOnly) {
|
if (!g_decodeOnly) {
|
||||||
UTIL_time_t clockTick, clockStart;
|
UTIL_time_t clockStart;
|
||||||
/* Compression */
|
/* Compression */
|
||||||
DISPLAYLEVEL(2, "%2s-%-17.17s :%10u ->\r", marks[markNb], displayName, (U32)srcSize);
|
DISPLAYLEVEL(2, "%2s-%-17.17s :%10u ->\r", marks[markNb], displayName, (U32)srcSize);
|
||||||
if (!cCompleted) memset(compressedBuffer, 0xE5, maxCompressedSize); /* warm up and erase result buffer */
|
if (!cCompleted) memset(compressedBuffer, 0xE5, maxCompressedSize); /* warm up and erase result buffer */
|
||||||
|
|
||||||
UTIL_sleepMilli(1); /* give processor time to other processes */
|
UTIL_sleepMilli(1); /* give processor time to other processes */
|
||||||
UTIL_waitForNextTick(ticksPerSecond);
|
UTIL_waitForNextTick(ticksPerSecond);
|
||||||
UTIL_initTimer(&clockTick);
|
|
||||||
UTIL_getTime(&clockStart);
|
UTIL_getTime(&clockStart);
|
||||||
|
|
||||||
if (!cCompleted) { /* still some time to do compression tests */
|
if (!cCompleted) { /* still some time to do compression tests */
|
||||||
@ -300,9 +298,9 @@ static int BMK_benchMem(const void* srcBuffer, size_t srcSize,
|
|||||||
blockTable[blockNb].cSize = rSize;
|
blockTable[blockNb].cSize = rSize;
|
||||||
}
|
}
|
||||||
nbLoops++;
|
nbLoops++;
|
||||||
} while (UTIL_clockSpanMicro(clockStart, clockTick) < clockLoop);
|
} while (UTIL_clockSpanMicro(clockStart, ticksPerSecond) < clockLoop);
|
||||||
ZSTD_freeCDict(cdict);
|
ZSTD_freeCDict(cdict);
|
||||||
{ U64 const clockSpanMicro = UTIL_clockSpanMicro(clockStart, clockTick);
|
{ U64 const clockSpanMicro = UTIL_clockSpanMicro(clockStart, ticksPerSecond);
|
||||||
if (clockSpanMicro < fastestC*nbLoops) fastestC = clockSpanMicro / nbLoops;
|
if (clockSpanMicro < fastestC*nbLoops) fastestC = clockSpanMicro / nbLoops;
|
||||||
totalCTime += clockSpanMicro;
|
totalCTime += clockSpanMicro;
|
||||||
cCompleted = (totalCTime >= maxTime);
|
cCompleted = (totalCTime >= maxTime);
|
||||||
@ -332,10 +330,9 @@ static int BMK_benchMem(const void* srcBuffer, size_t srcSize,
|
|||||||
if (!dCompleted) {
|
if (!dCompleted) {
|
||||||
U64 clockLoop = g_nbSeconds ? TIMELOOP_MICROSEC : 1;
|
U64 clockLoop = g_nbSeconds ? TIMELOOP_MICROSEC : 1;
|
||||||
U32 nbLoops = 0;
|
U32 nbLoops = 0;
|
||||||
UTIL_time_t clockStart, clockTick;
|
UTIL_time_t clockStart;
|
||||||
ZSTD_DDict* const ddict = ZSTD_createDDict(dictBuffer, dictBufferSize);
|
ZSTD_DDict* const ddict = ZSTD_createDDict(dictBuffer, dictBufferSize);
|
||||||
if (!ddict) EXM_THROW(2, "ZSTD_createDDict() allocation failure");
|
if (!ddict) EXM_THROW(2, "ZSTD_createDDict() allocation failure");
|
||||||
UTIL_initTimer(&clockTick);
|
|
||||||
UTIL_getTime(&clockStart);
|
UTIL_getTime(&clockStart);
|
||||||
do {
|
do {
|
||||||
U32 blockNb;
|
U32 blockNb;
|
||||||
@ -353,9 +350,9 @@ static int BMK_benchMem(const void* srcBuffer, size_t srcSize,
|
|||||||
blockTable[blockNb].resSize = regenSize;
|
blockTable[blockNb].resSize = regenSize;
|
||||||
}
|
}
|
||||||
nbLoops++;
|
nbLoops++;
|
||||||
} while (UTIL_clockSpanMicro(clockStart, clockTick) < clockLoop);
|
} while (UTIL_clockSpanMicro(clockStart, ticksPerSecond) < clockLoop);
|
||||||
ZSTD_freeDDict(ddict);
|
ZSTD_freeDDict(ddict);
|
||||||
{ U64 const clockSpanMicro = UTIL_clockSpanMicro(clockStart, clockTick);
|
{ U64 const clockSpanMicro = UTIL_clockSpanMicro(clockStart, ticksPerSecond);
|
||||||
if (clockSpanMicro < fastestD*nbLoops) fastestD = clockSpanMicro / nbLoops;
|
if (clockSpanMicro < fastestD*nbLoops) fastestD = clockSpanMicro / nbLoops;
|
||||||
totalDTime += clockSpanMicro;
|
totalDTime += clockSpanMicro;
|
||||||
dCompleted = (totalDTime >= maxTime);
|
dCompleted = (totalDTime >= maxTime);
|
||||||
|
@ -109,31 +109,41 @@ extern "C" {
|
|||||||
/*-****************************************
|
/*-****************************************
|
||||||
* Time functions
|
* Time functions
|
||||||
******************************************/
|
******************************************/
|
||||||
#if (PLATFORM_POSIX_VERSION >= 1)
|
#if defined(_WIN32) /* Windows */
|
||||||
#include <unistd.h>
|
typedef LARGE_INTEGER UTIL_freq_t;
|
||||||
#include <sys/times.h> /* times */
|
|
||||||
typedef U64 UTIL_time_t;
|
|
||||||
UTIL_STATIC void UTIL_initTimer(UTIL_time_t* ticksPerSecond) { *ticksPerSecond=sysconf(_SC_CLK_TCK); }
|
|
||||||
UTIL_STATIC void UTIL_getTime(UTIL_time_t* x) { struct tms junk; clock_t newTicks = (clock_t) times(&junk); (void)junk; *x = (UTIL_time_t)newTicks; }
|
|
||||||
UTIL_STATIC U64 UTIL_getSpanTimeMicro(UTIL_time_t ticksPerSecond, UTIL_time_t clockStart, UTIL_time_t clockEnd) { return 1000000ULL * (clockEnd - clockStart) / ticksPerSecond; }
|
|
||||||
UTIL_STATIC U64 UTIL_getSpanTimeNano(UTIL_time_t ticksPerSecond, UTIL_time_t clockStart, UTIL_time_t clockEnd) { return 1000000000ULL * (clockEnd - clockStart) / ticksPerSecond; }
|
|
||||||
#elif defined(_WIN32) /* Windows */
|
|
||||||
typedef LARGE_INTEGER UTIL_time_t;
|
typedef LARGE_INTEGER UTIL_time_t;
|
||||||
UTIL_STATIC void UTIL_initTimer(UTIL_time_t* ticksPerSecond) { if (!QueryPerformanceFrequency(ticksPerSecond)) fprintf(stderr, "ERROR: QueryPerformance not present\n"); }
|
UTIL_STATIC void UTIL_initTimer(UTIL_freq_t* ticksPerSecond) { if (!QueryPerformanceFrequency(ticksPerSecond)) fprintf(stderr, "ERROR: QueryPerformance not present\n"); }
|
||||||
UTIL_STATIC void UTIL_getTime(UTIL_time_t* x) { QueryPerformanceCounter(x); }
|
UTIL_STATIC void UTIL_getTime(UTIL_time_t* x) { QueryPerformanceCounter(x); }
|
||||||
UTIL_STATIC U64 UTIL_getSpanTimeMicro(UTIL_time_t ticksPerSecond, UTIL_time_t clockStart, UTIL_time_t clockEnd) { return 1000000ULL*(clockEnd.QuadPart - clockStart.QuadPart)/ticksPerSecond.QuadPart; }
|
UTIL_STATIC U64 UTIL_getSpanTimeMicro(UTIL_freq_t ticksPerSecond, UTIL_time_t clockStart, UTIL_time_t clockEnd) { return 1000000ULL*(clockEnd.QuadPart - clockStart.QuadPart)/ticksPerSecond.QuadPart; }
|
||||||
UTIL_STATIC U64 UTIL_getSpanTimeNano(UTIL_time_t ticksPerSecond, UTIL_time_t clockStart, UTIL_time_t clockEnd) { return 1000000000ULL*(clockEnd.QuadPart - clockStart.QuadPart)/ticksPerSecond.QuadPart; }
|
UTIL_STATIC U64 UTIL_getSpanTimeNano(UTIL_freq_t ticksPerSecond, UTIL_time_t clockStart, UTIL_time_t clockEnd) { return 1000000000ULL*(clockEnd.QuadPart - clockStart.QuadPart)/ticksPerSecond.QuadPart; }
|
||||||
|
#elif defined(__APPLE__) && defined(__MACH__)
|
||||||
|
#include <mach/mach_time.h>
|
||||||
|
typedef mach_timebase_info_data_t UTIL_freq_t;
|
||||||
|
typedef U64 UTIL_time_t;
|
||||||
|
UTIL_STATIC void UTIL_initTimer(UTIL_freq_t* rate) { mach_timebase_info(rate); }
|
||||||
|
UTIL_STATIC void UTIL_getTime(UTIL_time_t* x) { *x = mach_absolute_time(); }
|
||||||
|
UTIL_STATIC U64 UTIL_getSpanTimeMicro(UTIL_freq_t rate, UTIL_time_t clockStart, UTIL_time_t clockEnd) { return (((clockEnd - clockStart) * (U64)rate.numer) / ((U64)rate.denom))/1000ULL; }
|
||||||
|
UTIL_STATIC U64 UTIL_getSpanTimeNano(UTIL_freq_t rate, UTIL_time_t clockStart, UTIL_time_t clockEnd) { return ((clockEnd - clockStart) * (U64)rate.numer) / ((U64)rate.denom); }
|
||||||
|
#elif (PLATFORM_POSIX_VERSION >= 200112L)
|
||||||
|
#include <sys/times.h> /* times */
|
||||||
|
typedef U64 UTIL_freq_t;
|
||||||
|
typedef U64 UTIL_time_t;
|
||||||
|
UTIL_STATIC void UTIL_initTimer(UTIL_freq_t* ticksPerSecond) { *ticksPerSecond=sysconf(_SC_CLK_TCK); }
|
||||||
|
UTIL_STATIC void UTIL_getTime(UTIL_time_t* x) { struct tms junk; clock_t newTicks = (clock_t) times(&junk); (void)junk; *x = (UTIL_time_t)newTicks; }
|
||||||
|
UTIL_STATIC U64 UTIL_getSpanTimeMicro(UTIL_freq_t ticksPerSecond, UTIL_time_t clockStart, UTIL_time_t clockEnd) { return 1000000ULL * (clockEnd - clockStart) / ticksPerSecond; }
|
||||||
|
UTIL_STATIC U64 UTIL_getSpanTimeNano(UTIL_freq_t ticksPerSecond, UTIL_time_t clockStart, UTIL_time_t clockEnd) { return 1000000000ULL * (clockEnd - clockStart) / ticksPerSecond; }
|
||||||
#else /* relies on standard C (note : clock_t measurements can be wrong when using multi-threading) */
|
#else /* relies on standard C (note : clock_t measurements can be wrong when using multi-threading) */
|
||||||
|
typedef clock_t UTIL_freq_t;
|
||||||
typedef clock_t UTIL_time_t;
|
typedef clock_t UTIL_time_t;
|
||||||
UTIL_STATIC void UTIL_initTimer(UTIL_time_t* ticksPerSecond) { *ticksPerSecond=0; }
|
UTIL_STATIC void UTIL_initTimer(UTIL_freq_t* ticksPerSecond) { *ticksPerSecond=0; }
|
||||||
UTIL_STATIC void UTIL_getTime(UTIL_time_t* x) { *x = clock(); }
|
UTIL_STATIC void UTIL_getTime(UTIL_time_t* x) { *x = clock(); }
|
||||||
UTIL_STATIC U64 UTIL_getSpanTimeMicro(UTIL_time_t ticksPerSecond, UTIL_time_t clockStart, UTIL_time_t clockEnd) { (void)ticksPerSecond; return 1000000ULL * (clockEnd - clockStart) / CLOCKS_PER_SEC; }
|
UTIL_STATIC U64 UTIL_getSpanTimeMicro(UTIL_freq_t ticksPerSecond, UTIL_time_t clockStart, UTIL_time_t clockEnd) { (void)ticksPerSecond; return 1000000ULL * (clockEnd - clockStart) / CLOCKS_PER_SEC; }
|
||||||
UTIL_STATIC U64 UTIL_getSpanTimeNano(UTIL_time_t ticksPerSecond, UTIL_time_t clockStart, UTIL_time_t clockEnd) { (void)ticksPerSecond; return 1000000000ULL * (clockEnd - clockStart) / CLOCKS_PER_SEC; }
|
UTIL_STATIC U64 UTIL_getSpanTimeNano(UTIL_freq_t ticksPerSecond, UTIL_time_t clockStart, UTIL_time_t clockEnd) { (void)ticksPerSecond; return 1000000000ULL * (clockEnd - clockStart) / CLOCKS_PER_SEC; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* returns time span in microseconds */
|
/* returns time span in microseconds */
|
||||||
UTIL_STATIC U64 UTIL_clockSpanMicro( UTIL_time_t clockStart, UTIL_time_t ticksPerSecond )
|
UTIL_STATIC U64 UTIL_clockSpanMicro( UTIL_time_t clockStart, UTIL_freq_t ticksPerSecond )
|
||||||
{
|
{
|
||||||
UTIL_time_t clockEnd;
|
UTIL_time_t clockEnd;
|
||||||
UTIL_getTime(&clockEnd);
|
UTIL_getTime(&clockEnd);
|
||||||
@ -141,7 +151,7 @@ UTIL_STATIC U64 UTIL_clockSpanMicro( UTIL_time_t clockStart, UTIL_time_t ticksPe
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
UTIL_STATIC void UTIL_waitForNextTick(UTIL_time_t ticksPerSecond)
|
UTIL_STATIC void UTIL_waitForNextTick(UTIL_freq_t ticksPerSecond)
|
||||||
{
|
{
|
||||||
UTIL_time_t clockStart, clockEnd;
|
UTIL_time_t clockStart, clockEnd;
|
||||||
UTIL_getTime(&clockStart);
|
UTIL_getTime(&clockStart);
|
||||||
|
@ -160,7 +160,7 @@ static int BMK_benchMem(z_const void* srcBuffer, size_t srcSize,
|
|||||||
ZSTD_CCtx* const ctx = ZSTD_createCCtx();
|
ZSTD_CCtx* const ctx = ZSTD_createCCtx();
|
||||||
ZSTD_DCtx* const dctx = ZSTD_createDCtx();
|
ZSTD_DCtx* const dctx = ZSTD_createDCtx();
|
||||||
U32 nbBlocks;
|
U32 nbBlocks;
|
||||||
UTIL_time_t ticksPerSecond;
|
UTIL_freq_t ticksPerSecond;
|
||||||
|
|
||||||
/* checks */
|
/* checks */
|
||||||
if (!compressedBuffer || !resultBuffer || !blockTable || !ctx || !dctx)
|
if (!compressedBuffer || !resultBuffer || !blockTable || !ctx || !dctx)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user