Kernel/Net: Don't use TimePrecision::Precise when delaying TCP ACKs

If the peer is able to wait for ~500ms before receiving the ACK, it will
survive waiting the few more milliseconds that come with the imprecision
of the Coarse setting.

On x86_64, during a SFTP file transfer, the time spent on fetching the
precise clock can be as high as 10% of the total runtime.
This commit is contained in:
Lucas Chollet authored and Sönke Holz committed 2026-06-11 11:46:02 +02:00
1 parent 2c9372d345
commit f2f6962d3c
1 file changed
+1 -1
+1 -1
View File
@@ -396,7 +396,7 @@ bool TCPSocket::should_delay_next_ack() const
return false;
// RFC 1122 says we should not delay ACKs for more than 500 milliseconds.
if (TimeManagement::the().monotonic_time(TimePrecision::Precise) >= m_last_ack_sent_time + Duration::from_milliseconds(500))
if (TimeManagement::the().monotonic_time() >= m_last_ack_sent_time + Duration::from_milliseconds(500))
return false;
return true;