1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-29 11:21:22 +03:00

test-zstd-speed.py: added ZSTD_GIT_COMMIT

This commit is contained in:
inikep
2016-06-22 15:42:26 +02:00
parent c364ee7867
commit f2f59d758e
2 changed files with 9 additions and 5 deletions

View File

@ -42,6 +42,10 @@
/* ************************************* /* *************************************
* Constants * Constants
***************************************/ ***************************************/
#ifndef ZSTD_GIT_COMMIT
# define ZSTD_GIT_COMMIT ""
#endif
#define NBLOOPS 3 #define NBLOOPS 3
#define TIMELOOP_MICROSEC 1*1000000ULL /* 1 second */ #define TIMELOOP_MICROSEC 1*1000000ULL /* 1 second */
#define ACTIVEPERIOD_MICROSEC 70*1000000ULL /* 70 seconds */ #define ACTIVEPERIOD_MICROSEC 70*1000000ULL /* 70 seconds */
@ -359,7 +363,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: input %u bytes, %i iterations, %u KB blocks\n", ZSTD_VERSION_STRING, (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, (U32)benchedSize, g_nbIterations, (U32)(g_blockSize>>10));
if (cLevelLast < cLevel) cLevelLast = cLevel; if (cLevelLast < cLevel) cLevelLast = cLevel;

View File

@ -79,13 +79,13 @@ def git_get_branches():
return map(lambda l: l.strip(), output) return map(lambda l: l.strip(), output)
def git_get_changes(commit, last_commit): def git_get_changes(branch, commit, last_commit):
fmt = '--format="%h: (%an) %s, %ar"' fmt = '--format="%h: (%an) %s, %ar"'
if last_commit is None: if last_commit is None:
commits = execute('git log -n 10 %s %s' % (fmt, commit)) commits = execute('git log -n 10 %s %s' % (fmt, commit))
else: else:
commits = execute('git --no-pager log %s %s..%s' % (fmt, last_commit, commit)) commits = execute('git --no-pager log %s %s..%s' % (fmt, last_commit, commit))
return str('Changes since %s:\n' % (last_commit)) + '\n'.join(commits) return str('Changes in %s since %s:\n' % (branch, last_commit)) + '\n'.join(commits)
def compile(branch, commit, last_commit, dry_run): def compile(branch, commit, last_commit, dry_run):
@ -93,9 +93,9 @@ def compile(branch, commit, last_commit, dry_run):
version = local_branch.rpartition('-')[2] version = local_branch.rpartition('-')[2]
version = version + '_' + commit version = version + '_' + commit
execute('git checkout -- . && git checkout ' + branch) execute('git checkout -- . && git checkout ' + branch)
print(git_get_changes(commit, last_commit)) print(git_get_changes(branch, commit, last_commit))
if not dry_run: if not dry_run:
execute('VERSION=' + version + '; make clean zstdprogram') execute('make clean zstdprogram MOREFLAGS="-DZSTD_GIT_COMMIT=%s"' % version, print_output=True)
def get_last_results(resultsFileName): def get_last_results(resultsFileName):