Subject: bug#51734: 29.0.50; got slow

From: Ken Brown <[email-masked]>
Date: Thu, 11 Nov 2021 15:30:51 -0500

On 11/11/2021 3:20 PM, Eli Zaretskii wrote:
>> Date: Thu, 11 Nov 2021 15:17:23 -0500
>> From: Ken Brown <[email-masked]>
>> Cc: [email-masked], [email-masked]
>>
>> On 11/11/2021 2:28 PM, Ken Brown wrote:
>>> On 11/11/2021 1:42 PM, Eli Zaretskii wrote:
>>>> If no better idea comes up, we could disable that change on Cygwin.
>>>
>>> Sounds good.
>>
>> Here's a patch that does that.  Does it look OK?
> 
> ENOPATCH

Sorry.

From abe88311b7e47c1cdac2b2405d43ff19826fd911 Mon Sep 17 00:00:00 2001
From: Ken Brown <[email-masked]>
Date: Thu, 11 Nov 2021 15:09:24 -0500
Subject: [PATCH] Don't start both timerfd and alarms on Cygwin

* src/atimer.c (set_alarm) [CYGWIN]: Don't start both timerfd and
alarms; this causes a slowdown.  (Bug#51734)
---
 src/atimer.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/atimer.c b/src/atimer.c
index 490c21bff1..9bde9c2446 100644
--- a/src/atimer.c
+++ b/src/atimer.c
@@ -316,6 +316,13 @@ set_alarm (void)
 	      exit = true;
 	    }
 # endif
+
+# ifdef CYGWIN
+	  /* Don't start both timerfd and alarms on Cygwin; this
+	     causes a slowdown (bug#51734). */
+	  if (exit)
+	    return;
+# endif
 	  if (alarm_timer_ok
 	      && timer_settime (alarm_timer, TIMER_ABSTIME, &ispec, 0) == 0)
 	    exit = true;
-- 
2.33.0