* implement a memory-optimized time.Time replacement
* monotime: properly handle systems with bad timer resolution (Windows)
* monotime: simplify Since
This allows for more accurate packet number difference calculations,
which is especially important once we attempt to detect spurious loss
detection events.
* ackhandler: optimize memory layout of packet struct
The packet number can be derived from the position that this packet is
stored at in the packets slice in the sent packet history. There is no
need to store the packet number, saving 8 bytes per packet.
* ackhandler: avoid copying the packet struct
* ackhandler: simplify deletion of old packets in packet history
* ackhandler: use a slice to keep track of sent packets
This is a vastly simpler data structure than the combination of map
and linked list used before. It avoids using a linked list (bad cache
locality) and a sync.Pool (for list elements), as well as having to do
hash table lookups.
In the future, this can be easily replaces with a ring buffer, avoiding
all allocations.
* ackhandler: don't store packets that were declared lost
* optimize FirstOutstanding
* fix variable naming
* bug fix
* minor code improvements
* add a test to make sure that `Iterate` iterates in the right order
* add comment
Packet numbers now start at 0 for every packet number spaces.
Furthermore, an ACK frame now only acknowledges packets in the packet
number space it was sent in.