aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2024-05-20 22:47:33 -0500
committerluigi1111 <luigi1111w@gmail.com>2024-05-20 22:47:33 -0500
commitd95414aa221749afb471835df3aa0505b504ec6e (patch)
tree7f85231d430141565293da68373552daccb70b8c /tests
parentMerge pull request #8488 (diff)
parentupdate TimingsDatabase to support csv format and incremental updating (diff)
downloadmonero-d95414aa221749afb471835df3aa0505b504ec6e.tar.xz
Merge pull request #8920
236e5d4 update TimingsDatabase to support csv format and incremental updating (koe)
Diffstat (limited to 'tests')
-rw-r--r--tests/performance_tests/performance_tests.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/performance_tests/performance_tests.h b/tests/performance_tests/performance_tests.h
index 0f16ff8fc..68679a36c 100644
--- a/tests/performance_tests/performance_tests.h
+++ b/tests/performance_tests/performance_tests.h
@@ -249,7 +249,7 @@ bool run_test(const std::string &filter, ParamsT &params_shuttle, const char* te
double stddev = runner.get_stddev();
double npskew = runner.get_non_parametric_skew();
- std::vector<TimingsDatabase::instance> prev_instances = params.td.get(test_name);
+ const TimingsDatabase::instance* prev_instance = params.td.get_most_recent(test_name);
params.td.add(test_name, {time(NULL), runner.get_size(), min, max, mean, med, stddev, npskew, quantiles});
std::cout << (params.verbose ? " time per call: " : " ") << time_per_call << " " << unit << "/call" << (params.verbose ? "\n" : "");
@@ -260,15 +260,14 @@ bool run_test(const std::string &filter, ParamsT &params_shuttle, const char* te
uint64_t p95s = quantiles[9] / scale;
uint64_t stddevs = stddev / scale;
std::string cmp;
- if (!prev_instances.empty())
+ if (prev_instance)
{
- const TimingsDatabase::instance &prev_instance = prev_instances.back();
- if (!runner.is_same_distribution(prev_instance.npoints, prev_instance.mean, prev_instance.stddev))
+ if (!runner.is_same_distribution(prev_instance->npoints, prev_instance->mean, prev_instance->stddev))
{
- double pc = fabs(100. * (prev_instance.mean - runner.get_mean()) / prev_instance.mean);
- cmp = ", " + std::to_string(pc) + "% " + (mean > prev_instance.mean ? "slower" : "faster");
+ double pc = fabs(100. * (prev_instance->mean - runner.get_mean()) / prev_instance->mean);
+ cmp = ", " + std::to_string(pc) + "% " + (mean > prev_instance->mean ? "slower" : "faster");
}
- cmp += " -- " + std::to_string(prev_instance.mean);
+ cmp += " -- " + std::to_string(prev_instance->mean);
}
std::cout << " (min " << mins << " " << unit << ", 90th " << p95s << " " << unit << ", median " << meds << " " << unit << ", std dev " << stddevs << " " << unit << ")" << cmp;
}