Skip to content

SwiftQUIC: PERF: Avoid per-path scan unless round trip time has elapsed - #79

Open
agnosticdev wants to merge 2 commits into
mainfrom
agnosticdev/PerPathScan
Open

SwiftQUIC: PERF: Avoid per-path scan unless round trip time has elapsed#79
agnosticdev wants to merge 2 commits into
mainfrom
agnosticdev/PerPathScan

Conversation

@agnosticdev

Copy link
Copy Markdown
Collaborator

Each call to updateMaximumUnreadInboundBytesAllowed does a per-path scan on each inbound packet to tune the receive buffer.
This change gates the per-path scan behind a full round trip elapsing. This is based on the smoothedRTT of the current path.

Top of tree:

98.93 M 52.6%		  QUICStreamInstance.updateMaximumUnreadInboundBytesAllowed(dataLengthAdded:connection:)
84.00 M 44.7%	-      	specialized ManyToManyProtocolHandler.applyToAllPaths(_:)
44.00 M 23.4%	-      	  specialized Sequence.forEach(_:)
40.00 M 21.3%	-      	  protocol witness for ManyToManyProtocolHandler.multiplexingPaths.getter in conformance QUICConnection
2.00 M  1.1%	-	    FlowControlGlobals.shared.unsafeMutableAddressor
1.00 M  0.5%	- 	    QUICStreamInstance.computeReceiveHighWaterMarkIncrease(dataLength:rtt:mss:now:)

With this change:

42.62 M 48.1%	-      	QUICStreamInstance.updateMaximumUnreadInboundBytesAllowed(dataLengthAdded:connection:)
42.62 M 48.1%	-	      QUICStreamInstance.computeReceiveHighWaterMarkIncrease(dataLength:connection:now:)
35.62 M 40.2%	-      	   QUICPath.smoothedRTT.getter
22.00 M 24.8%	-	        swift_beginAccess	
8.19 M  9.2%	-	        <deduplicated_symbol>	
5.42 M  6.1%	- 	        DYLD-STUB$$swift_beginAccess

Savings of 56 megacycles for both client and server so 112 megacycles total.

@agnosticdev

Copy link
Copy Markdown
Collaborator Author

Note that the build issue on nightly-main is a known issue right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant