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. --- toxcore/net_crypto.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'toxcore/net_crypto.c') diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c index 8f5fd507..bd214b91 100644 --- a/toxcore/net_crypto.c +++ b/toxcore/net_crypto.c @@ -2925,8 +2925,6 @@ void load_secret_key(Net_Crypto *c, const uint8_t *sk) */ Net_Crypto *new_net_crypto(const Logger *log, DHT *dht, TCP_Proxy_Info *proxy_info) { - unix_time_update(); - if (dht == nullptr) { return nullptr; } @@ -3016,7 +3014,6 @@ uint32_t crypto_run_interval(const Net_Crypto *c) /* Main loop. */ void do_net_crypto(Net_Crypto *c, void *userdata) { - unix_time_update(); kill_timedout(c, userdata); do_tcp(c, userdata); send_crypto_packets(c); -- cgit v1.2.3