Commit 76f1622e by FritzFlorian

Add very simple tool to compare performance impact of current changes

parent f0f3b80e
Pipeline #1139 passed with stages
in 3 minutes 28 seconds
......@@ -42,11 +42,6 @@ Available Settings:
- Only one sanitizer can be active at once
- Enabling has a performance hit (do not use in releases)
commit | fft(1) | fft(2)
--- | --- | ---
[d2eff7da](https://lab.las3.de/gitlab/las3/development/scheduling/predictable_parallel_patterns/commit/d2eff7dafcd822a4da662c2b4606d504b8545483) | 12.5ms <span style="color:green">-5.3%</span> | 6.5ms <span style="color:green">-5.3%</span>
### Testing
Testing is done using [Catch2](https://github.com/catchorg/Catch2/)
......
......@@ -81,7 +81,7 @@ int main() {
pls::internal::helpers::run_mini_benchmark([&] {
complex_vector input = initial_input;
fft(input.begin(), input.size());
}, 8);
}, 8, 4000);
PROFILE_SAVE("test_profile.prof")
}
#!bin/python3
import sys
import os
if len(sys.argv) < 2:
print("Please pass the name of the benchmark target as an argument!")
exit(1)
target = sys.argv[1]
print('Comparing current modifications for benchmark target ' + target)
print('Executing current version...')
print(os.popen('cd cmake-build-release; make ' + target).read())
current = os.popen('chrt -rr 99 ./cmake-build-release/bin/' + target).read()
print('Executing old version...')
print(os.popen('git stash push').read())
print(os.popen('cd cmake-build-release; make ' + target).read())
before = os.popen('chrt -rr 99 ./cmake-build-release/bin/' + target).read()
print(os.popen('git stash pop').read())
print('=======================================================')
current = [float(value) for value in current.split(',')]
before = [float(value) for value in before.split(',')]
def formate_change(change):
if change > 1.05:
color = '31'
elif change < 0.95:
color = '32'
else:
color = '30'
return '\033[1;' + color + ';40m %8.2f' % (change * 100) + ' %'
format_string = ' '.join(['%10.2f us'] * len(current))
print('old: ' + format_string % tuple(before))
print('new: ' + format_string % tuple(current))
print('=' * 55)
change = [c / b for b, c in zip(before, current)]
formated_change = ''.join(list(map(formate_change, change)))
print(formated_change)
......@@ -41,7 +41,7 @@ namespace pls {
std::cout << time_per_iteration;
if (num_threads < max_threads) {
std::cout << ", ";
std::cout << ",";
}
}
std::cout << std::endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment