-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add benchmark test for ci * add 8 threads * seperate debug and release * skip 2 warmup tests * set name for profiler * fix split id
- Loading branch information
Showing
4 changed files
with
163 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env python3 | ||
# script to check benchmark result in GitHub actions | ||
# set input parameter 1 as test type, 2 as test result file path | ||
# if the benchmark result is better than the standard, return 0, else return 1 | ||
|
||
import sys | ||
|
||
|
||
def main(): | ||
benchmark_bars = {"sift_1": 2.256, "sift_4": 0.869, "sift_8": 0.501} | ||
benchmark_id = sys.argv[1] | ||
standard = benchmark_bars[benchmark_id] | ||
file_path = sys.argv[2] | ||
with open(file_path, 'r') as f: | ||
last_line = f.readlines()[-1] | ||
print() | ||
print("last line from log:", last_line) | ||
result = float(last_line.split(' ')[-2]) | ||
print("average time:", result, 's') | ||
print("required time:", standard, 's') | ||
print() | ||
difference_percentage = 100 * (result - standard) / standard | ||
print("difference percentage: {:.2f}%".format(difference_percentage)) | ||
print() | ||
if difference_percentage < 3: | ||
print("benchmark result is acceptable") | ||
sys.exit(0) | ||
else: | ||
print("benchmark result is unacceptable") | ||
sys.exit(1) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |