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:
@ -42,6 +42,10 @@
|
||||
/* *************************************
|
||||
* Constants
|
||||
***************************************/
|
||||
#ifndef ZSTD_GIT_COMMIT
|
||||
# define ZSTD_GIT_COMMIT ""
|
||||
#endif
|
||||
|
||||
#define NBLOOPS 3
|
||||
#define TIMELOOP_MICROSEC 1*1000000ULL /* 1 second */
|
||||
#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));
|
||||
|
||||
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;
|
||||
|
||||
|
@ -79,13 +79,13 @@ def git_get_branches():
|
||||
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"'
|
||||
if last_commit is None:
|
||||
commits = execute('git log -n 10 %s %s' % (fmt, commit))
|
||||
else:
|
||||
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):
|
||||
@ -93,9 +93,9 @@ def compile(branch, commit, last_commit, dry_run):
|
||||
version = local_branch.rpartition('-')[2]
|
||||
version = version + '_' + commit
|
||||
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:
|
||||
execute('VERSION=' + version + '; make clean zstdprogram')
|
||||
execute('make clean zstdprogram MOREFLAGS="-DZSTD_GIT_COMMIT=%s"' % version, print_output=True)
|
||||
|
||||
|
||||
def get_last_results(resultsFileName):
|
||||
|
Reference in New Issue
Block a user