mirror of
https://github.com/facebook/zstd.git
synced 2025-07-30 22:23:13 +03:00
bench.c: added support for ZSTD_GIT_COMMIT
This commit is contained in:
@ -43,7 +43,9 @@
|
|||||||
* Constants
|
* Constants
|
||||||
***************************************/
|
***************************************/
|
||||||
#ifndef ZSTD_GIT_COMMIT
|
#ifndef ZSTD_GIT_COMMIT
|
||||||
# define ZSTD_GIT_COMMIT ""
|
# define ZSTD_GIT_COMMIT_STRING ""
|
||||||
|
#else
|
||||||
|
# define ZSTD_GIT_COMMIT_STRING ZSTD_EXPAND_AND_QUOTE(ZSTD_GIT_COMMIT)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define NBLOOPS 3
|
#define NBLOOPS 3
|
||||||
@ -363,7 +365,7 @@ static void BMK_benchCLevel(void* srcBuffer, size_t benchedSize,
|
|||||||
memset(&total, 0, sizeof(total));
|
memset(&total, 0, sizeof(total));
|
||||||
|
|
||||||
if (g_displayLevel == 1 && !g_additionalParam)
|
if (g_displayLevel == 1 && !g_additionalParam)
|
||||||
DISPLAY("bench %s %s: input %u bytes, %i iterations, %u KB blocks\n", ZSTD_VERSION_STRING, ZSTD_GIT_COMMIT, (U32)benchedSize, g_nbIterations, (U32)(g_blockSize>>10));
|
DISPLAY("bench %s %s: input %u bytes, %i iterations, %u KB blocks\n", ZSTD_VERSION_STRING, ZSTD_GIT_COMMIT_STRING, (U32)benchedSize, g_nbIterations, (U32)(g_blockSize>>10));
|
||||||
|
|
||||||
if (cLevelLast < cLevel) cLevelLast = cLevel;
|
if (cLevelLast < cLevel) cLevelLast = cLevel;
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ def compile(branch, commit, last_commit, dry_run):
|
|||||||
execute('git checkout -- . && git checkout ' + branch)
|
execute('git checkout -- . && git checkout ' + branch)
|
||||||
print(git_get_changes(branch, commit, last_commit))
|
print(git_get_changes(branch, commit, last_commit))
|
||||||
if not dry_run:
|
if not dry_run:
|
||||||
execute('make clean zstdprogram MOREFLAGS="-DZSTD_GIT_COMMIT=%s"' % version, print_output=True)
|
execute('make clean zstdprogram MOREFLAGS="-DZSTD_GIT_COMMIT=%s"' % version)
|
||||||
|
|
||||||
|
|
||||||
def get_last_results(resultsFileName):
|
def get_last_results(resultsFileName):
|
||||||
@ -148,9 +148,7 @@ def benchmark_and_compare(branch, commit, resultsFileName, lastCLevel, testFileP
|
|||||||
return text
|
return text
|
||||||
|
|
||||||
|
|
||||||
def check_branch(branch, args, testFilePaths, have_mutt, have_mail):
|
def check_commit(branch, commit, args, testFilePaths, have_mutt, have_mail):
|
||||||
commits = execute('git show -s --format=%h ' + branch)[0]
|
|
||||||
for commit in [commits]:
|
|
||||||
try:
|
try:
|
||||||
last_commit = None
|
last_commit = None
|
||||||
commitFileName = working_path + "/commit_" + branch.replace("/", "_")
|
commitFileName = working_path + "/commit_" + branch.replace("/", "_")
|
||||||
@ -160,7 +158,7 @@ def check_branch(branch, args, testFilePaths, have_mutt, have_mail):
|
|||||||
|
|
||||||
if commit == last_commit:
|
if commit == last_commit:
|
||||||
log("skipping branch %s: head %s already processed" % (branch, commit))
|
log("skipping branch %s: head %s already processed" % (branch, commit))
|
||||||
continue
|
return
|
||||||
|
|
||||||
log("build branch %s: head %s is different from prev %s" % (branch, commit, last_commit))
|
log("build branch %s: head %s is different from prev %s" % (branch, commit, last_commit))
|
||||||
compile(branch, commit, last_commit, args.dry_run)
|
compile(branch, commit, last_commit, args.dry_run)
|
||||||
@ -259,7 +257,9 @@ if __name__ == '__main__':
|
|||||||
if (loadavg <= args.maxLoadAvg):
|
if (loadavg <= args.maxLoadAvg):
|
||||||
branches = git_get_branches()
|
branches = git_get_branches()
|
||||||
for branch in branches:
|
for branch in branches:
|
||||||
check_branch(branch, args, testFilePaths, have_mutt, have_mail)
|
commits = execute('git show -s --format=%h ' + branch)[0]
|
||||||
|
for commit in [commits]:
|
||||||
|
check_commit(branch, commit, args, testFilePaths, have_mutt, have_mail)
|
||||||
else:
|
else:
|
||||||
log("WARNING: main loadavg=%.2f is higher than %s" % (loadavg, args.maxLoadAvg))
|
log("WARNING: main loadavg=%.2f is higher than %s" % (loadavg, args.maxLoadAvg))
|
||||||
log("sleep for %s seconds" % args.sleepTime)
|
log("sleep for %s seconds" % args.sleepTime)
|
||||||
|
Reference in New Issue
Block a user