[tarantool-patches] [PATCH 4/5] swim: speed-up tests
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Thu Jul 4 02:28:33 MSK 2019
With following patches some of the tests will work much slower
due to significantly increased size of the most of packets.
This commit tries to smooth it by
* Turning off verbose logs in unit tests;
* Using much more light version of UUID comparator.
According to the profiler these places increase speed in a
couple of times, and at the same time they are simple.
Needed for #4253
---
src/lib/swim/swim.c | 4 ++--
test/unit/swim_test_utils.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/lib/swim/swim.c b/src/lib/swim/swim.c
index 4f01d623a..e9f99015c 100644
--- a/src/lib/swim/swim.c
+++ b/src/lib/swim/swim.c
@@ -430,8 +430,8 @@ struct mh_swim_table_key {
#define mh_arg_t void *
#define mh_hash(a, arg) ((*a)->hash)
#define mh_hash_key(a, arg) (a.hash)
-#define mh_cmp(a, b, arg) (tt_uuid_compare(&(*a)->uuid, &(*b)->uuid))
-#define mh_cmp_key(a, b, arg) (tt_uuid_compare(a.uuid, &(*b)->uuid))
+#define mh_cmp(a, b, arg) (!tt_uuid_is_equal(&(*a)->uuid, &(*b)->uuid))
+#define mh_cmp_key(a, b, arg) (!tt_uuid_is_equal(a.uuid, &(*b)->uuid))
#define MH_SOURCE 1
#include "salad/mhash.h"
diff --git a/test/unit/swim_test_utils.c b/test/unit/swim_test_utils.c
index bfefcbaf9..7da82d93c 100644
--- a/test/unit/swim_test_utils.c
+++ b/test/unit/swim_test_utils.c
@@ -869,7 +869,7 @@ swim_run_test(const char *log_file, fiber_func test)
int fd = open(log_file, O_TRUNC);
if (fd != -1)
close(fd);
- say_logger_init(log_file, 6, 1, "plain", 0);
+ say_logger_init(log_file, 5, 1, "plain", 0);
/*
* Print the seed to be able to reproduce a bug with the
* same seed.
--
2.20.1 (Apple Git-117)
More information about the Tarantool-patches
mailing list