mirror of
https://github.com/SerenityOS/serenity.git
synced 2026-11-07 04:29:30 -10:00
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:
1 parent
2c9372d345
commit
f2f6962d3c
1 file changed
+1
-1
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user