From 54066f338f185f2fbd6694d9a4877f42cbfa21c8 Mon Sep 17 00:00:00 2001 From: iphydf Date: Thu, 9 Aug 2018 23:53:39 +0000 Subject: Reduce the number of times `unix_time_update` is called. Reduced by, e.g.: * `file_transfer_test`: 33% of the `clock_gettime` calls. * `tox_many_test`: 53% of the `clock_gettime` calls. Other tests will see similar improvements. Real world applications will be closer to 40-50% improvement, since tox_many_test has 100 nodes, while file_transfer_test has 2 nodes. --- other/bootstrap_daemon/src/tox-bootstrapd.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'other/bootstrap_daemon/src') diff --git a/other/bootstrap_daemon/src/tox-bootstrapd.c b/other/bootstrap_daemon/src/tox-bootstrapd.c index b17fc2ba..d75018d8 100644 --- a/other/bootstrap_daemon/src/tox-bootstrapd.c +++ b/other/bootstrap_daemon/src/tox-bootstrapd.c @@ -230,6 +230,8 @@ int main(int argc, char *argv[]) IP ip; ip_init(&ip, enable_ipv6); + unix_time_update(); + Logger *logger = logger_new(); Networking_Core *net = new_networking(logger, ip, port); @@ -336,6 +338,8 @@ int main(int argc, char *argv[]) } while (1) { + unix_time_update(); + do_dht(dht); if (enable_lan_discovery && is_timeout(last_LANdiscovery, LAN_DISCOVERY_INTERVAL)) { -- cgit v1.2.3