mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 20:27:35 +03:00
disable FIN-packing optimization, increasing transfer rate by 5%
This commit is contained in:
parent
934fc5b6a0
commit
d837cd96b2
2 changed files with 9 additions and 40 deletions
|
@ -1,8 +1,6 @@
|
|||
package quic
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
|
||||
"github.com/lucas-clemente/quic-go/flowcontrol"
|
||||
"github.com/lucas-clemente/quic-go/frames"
|
||||
"github.com/lucas-clemente/quic-go/protocol"
|
||||
|
@ -102,13 +100,7 @@ func (f *streamFramer) maybePopNormalFrames(maxBytes protocol.ByteCount) (res []
|
|||
|
||||
data := s.getDataForWriting(maxLen)
|
||||
|
||||
// Here, stream.Write() may return in parallel. Afterwards, the user may
|
||||
// call stream.Close(). We want to pack the FIN into the same frame,
|
||||
// so we speculatively allow the other goroutines to run.
|
||||
// In tests, this increased the percentage of FINs packed into the same
|
||||
// frame from ~20% to ~97%.
|
||||
runtime.Gosched()
|
||||
|
||||
// This is unlikely, but check it nonetheless, the scheduler might have jumped in. Seems to happen in ~20% of cases in the tests.
|
||||
shouldSendFin := s.shouldSendFin()
|
||||
if data == nil && !shouldSendFin {
|
||||
return true, nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue