From ecc07012c0afae2baf1caf12ddde5aa489612605 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Mon, 16 Jan 2023 15:06:28 +0100 Subject: [PATCH] Reduce hash speed test duration to 200 ms --- test/unit/bay-hash-speed.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/test/unit/bay-hash-speed.c b/test/unit/bay-hash-speed.c index 60055da..469275a 100644 --- a/test/unit/bay-hash-speed.c +++ b/test/unit/bay-hash-speed.c @@ -45,10 +45,9 @@ dummy_work(struct chan *c) } static double -measure_hash(struct bay *bay) +measure_hash(struct bay *bay, double T) { double t0 = get_time(); - double T = 5.0; double t1 = t0 + T; char name[MAX_CHAN_NAME]; @@ -72,10 +71,9 @@ measure_hash(struct bay *bay) } static double -measure_direct(void) +measure_direct(double T) { double t0 = get_time(); - double T = 5.0; double t1 = t0 + T; long nlookups = 0; @@ -96,8 +94,9 @@ measure_direct(void) static void test_speed(struct bay *bay) { - double hash = measure_hash(bay); - double direct = measure_direct(); + double T = 0.200; + double hash = measure_hash(bay, T); + double direct = measure_direct(T); double slowdown = hash / direct; err("slowdown speed_hash/speed_direct = %f\n", slowdown);