implement a memory-optimized time.Time replacement (#5334)

* implement a memory-optimized time.Time replacement

* monotime: properly handle systems with bad timer resolution (Windows)

* monotime: simplify Since
This commit is contained in:
Marten Seemann
2025-09-14 14:12:10 +08:00
committed by GitHub
parent f61188b8ff
commit adc13be540
75 changed files with 1003 additions and 797 deletions

View File

@@ -2,8 +2,8 @@ package ackhandler
import (
"sync"
"time"
"github.com/quic-go/quic-go/internal/monotime"
"github.com/quic-go/quic-go/internal/protocol"
)
@@ -14,7 +14,7 @@ type packetWithPacketNumber struct {
// A Packet is a packet
type packet struct {
SendTime time.Time
SendTime monotime.Time
StreamFrames []StreamFrame
Frames []Frame
LargestAcked protocol.PacketNumber // InvalidPacketNumber if the packet doesn't contain an ACK
@@ -41,7 +41,7 @@ func getPacket() *packet {
p.LargestAcked = 0
p.Length = 0
p.EncryptionLevel = protocol.EncryptionLevel(0)
p.SendTime = time.Time{}
p.SendTime = 0
p.IsPathMTUProbePacket = false
p.includedInBytesInFlight = false
p.declaredLost = false