From 3dcb39f8ec710eee40028d4f0ba0fcc4285dfe1a Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Fri, 7 Aug 2020 23:13:13 -0700 Subject: [PATCH] Improve codegen of generation_list_t::operator== Bizarrely comparing three integers showed up heavy in traces. This reduces the time in seq_echo by about 500 msec. --- src/topic_monitor.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/topic_monitor.h b/src/topic_monitor.h index 10511a557..baa11b309 100644 --- a/src/topic_monitor.h +++ b/src/topic_monitor.h @@ -107,7 +107,10 @@ class generation_list_t { return valid; } - bool operator==(const generation_list_t &rhs) const { return as_array() == rhs.as_array(); } + bool operator==(const generation_list_t &rhs) const { + return sighupint == rhs.sighupint && sigchld == rhs.sigchld && + internal_exit == rhs.internal_exit; + } bool operator!=(const generation_list_t &rhs) const { return !(*this == rhs); }