Netstack/netstack.go uses coalescingRead() to read from the underlying TCP endpoint which in turn calls fetchReadView(). fetchReadView() internally calls Endpoint.Read() which locks/unlocks the endpoint mutex. Given that in case of TCP especially the coalescingRead() can be quite large and each packet when read via fdbased/endpoint.go is made up multiple views the number of locks/unlocks required add significant contention on the endpoint lock.
Acquiring the lock once at start of coalescingRead and unlocking at end should significantly reduce the contention on the endpoint mutex.
Netstack/netstack.go uses coalescingRead() to read from the underlying TCP endpoint which in turn calls fetchReadView(). fetchReadView() internally calls Endpoint.Read() which locks/unlocks the endpoint mutex. Given that in case of TCP especially the coalescingRead() can be quite large and each packet when read via fdbased/endpoint.go is made up multiple views the number of locks/unlocks required add significant contention on the endpoint lock.
Acquiring the lock once at start of coalescingRead and unlocking at end should significantly reduce the contention on the endpoint mutex.