Skip to content

React to "Shrink StringValues" #8864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 5, 2019

Conversation

benaadams
Copy link
Member

StringValues has been shrunk to single pointer size; so in offers no advantages.

React to dotnet/extensions#1283

/cc @Tratcher @davidfowl

@benaadams benaadams force-pushed the React-to-Shrink-StringValues branch from e5811b4 to 80cb050 Compare March 27, 2019 21:27
Copy link
Member

@davidfowl davidfowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dougbu when do we take new Extensions changes? I'd like to get this merged ASAP dotnet/extensions@2f8e1fb

@dougbu
Copy link
Contributor

dougbu commented Mar 28, 2019

when do we take new Extensions changes?

If you mean "pick up the latest Extensions build as an AspNetCore dependency", I'll be sending out a PR in a bit…

@analogrelay analogrelay added this to the 3.0.0-preview4 milestone Mar 28, 2019
@jkotalik jkotalik added the blocked The work on this issue is blocked due to some dependency label Mar 29, 2019
@davidfowl davidfowl removed the blocked The work on this issue is blocked due to some dependency label Apr 5, 2019
@davidfowl
Copy link
Member

This is unblocked now

@davidfowl davidfowl merged commit 77380fb into dotnet:master Apr 5, 2019
@benaadams benaadams deleted the React-to-Shrink-StringValues branch April 5, 2019 19:25
@benaadams
Copy link
Member Author

Confirming impact of "Shrink StringValues" on "Reuse previous materialized strings" 1.1M requests + 128 connection allocations

Before
image

After
image

@davidfowl
Copy link
Member

Ah Pipe is the biggest 😫

@Tratcher
Copy link
Member

Tratcher commented Apr 6, 2019

Only because you make twice as many of them. Http1Connection is the real beast.

@benaadams
Copy link
Member Author

Spare a thought for SocketAwaitableEventArgs

Type layout for 'SocketAwaitableEventArgs'
Size: 336 bytes. Paddings: 5 bytes (%1 of empty space)
|=======================================================================|
| Object Header (8 bytes)                                               |
|-----------------------------------------------------------------------|
| Method Table Ptr (8 bytes)                                            |
|=======================================================================|
|   0-7: Socket _acceptSocket (8 bytes)                                 |
|-----------------------------------------------------------------------|
|  8-15: Socket _connectSocket (8 bytes)                                |
|-----------------------------------------------------------------------|
| 16-23: IList`1 _bufferList (8 bytes)                                  |
|-----------------------------------------------------------------------|
| 24-31: List`1 _bufferListInternal (8 bytes)                           |
|-----------------------------------------------------------------------|
| 32-39: EndPoint _remoteEndPoint (8 bytes)                             |
|-----------------------------------------------------------------------|
| 40-47: SendPacketsElement[] _sendPacketsElements (8 bytes)            |
|-----------------------------------------------------------------------|
| 48-55: Exception _connectByNameError (8 bytes)                        |
|-----------------------------------------------------------------------|
| 56-63: Object _userToken (8 bytes)                                    |
|-----------------------------------------------------------------------|
| 64-71: Byte[] _acceptBuffer (8 bytes)                                 |
|-----------------------------------------------------------------------|
| 72-79: SocketAddress _socketAddress (8 bytes)                         |
|-----------------------------------------------------------------------|
| 80-87: ExecutionContext _context (8 bytes)                            |
|-----------------------------------------------------------------------|
| 88-95: Socket _currentSocket (8 bytes)                                |
|-----------------------------------------------------------------------|
| 96-103: MultipleConnectAsync _multipleConnect (8 bytes)               |
|-----------------------------------------------------------------------|
| 104-111: EventHandler`1 Completed (8 bytes)                           |
|-----------------------------------------------------------------------|
| 112-119: WSABuffer[] _wsaBufferArray (8 bytes)                        |
|-----------------------------------------------------------------------|
| 120-127: GCHandle[] _multipleBufferGCHandles (8 bytes)                |
|-----------------------------------------------------------------------|
| 128-135: Byte[] _wsaMessageBuffer (8 bytes)                           |
|-----------------------------------------------------------------------|
| 136-143: Byte[] _controlBuffer (8 bytes)                              |
|-----------------------------------------------------------------------|
| 144-151: WSABuffer[] _wsaRecvMsgWSABufferArray (8 bytes)              |
|-----------------------------------------------------------------------|
| 152-159: SocketAddress _pinnedSocketAddress (8 bytes)                 |
|-----------------------------------------------------------------------|
| 160-167: FileStream[] _sendPacketsFileStreams (8 bytes)               |
|-----------------------------------------------------------------------|
| 168-175: PreAllocatedOverlapped _preAllocatedOverlapped (8 bytes)     |
|-----------------------------------------------------------------------|
| 176-183: StrongBox`1 _strongThisRef (8 bytes)                         |
|-----------------------------------------------------------------------|
| 184-187: Int32 _offset (4 bytes)                                      |
|-----------------------------------------------------------------------|
| 188-191: Int32 _count (4 bytes)                                       |
|-----------------------------------------------------------------------|
| 192-195: Int32 _bytesTransferred (4 bytes)                            |
|-----------------------------------------------------------------------|
| 196-199: SocketAsyncOperation _completedOperation (4 bytes)           |
|-----------------------------------------------------------------------|
| 200-203: Int32 _sendPacketsSendSize (4 bytes)                         |
|-----------------------------------------------------------------------|
| 204-207: TransmitFileOptions _sendPacketsFlags (4 bytes)              |
|-----------------------------------------------------------------------|
| 208-211: SocketError _socketError (4 bytes)                           |
|-----------------------------------------------------------------------|
| 212-215: SocketFlags _socketFlags (4 bytes)                           |
|-----------------------------------------------------------------------|
| 216-219: Int32 _acceptAddressBufferCount (4 bytes)                    |
|-----------------------------------------------------------------------|
| 220-223: Int32 _operating (4 bytes)                                   |
|-----------------------------------------------------------------------|
|   224: Boolean _bufferIsExplicitArray (1 byte)                        |
|-----------------------------------------------------------------------|
|   225: Boolean _disconnectReuseSocket (1 byte)                        |
|-----------------------------------------------------------------------|
|   226: Boolean _flowExecutionContext (1 byte)                         |
|-----------------------------------------------------------------------|
|   227: Boolean _userSocket (1 byte)                                   |
|-----------------------------------------------------------------------|
|   228: Boolean _disposeCalled (1 byte)                                |
|-----------------------------------------------------------------------|
|   229: SingleBufferHandleState _singleBufferHandleState (1 byte)      |
|-----------------------------------------------------------------------|
|   230: PinState _pinState (1 byte)                                    |
|-----------------------------------------------------------------------|
|   231: padding (1 byte)                                               |
|-----------------------------------------------------------------------|
| 232-247: Memory`1 _buffer (16 bytes)                                  |
| |=================================|                                   |
| |   0-7: Object _object (8 bytes) |                                   |
| |---------------------------------|                                   |
| |  8-11: Int32 _index (4 bytes)   |                                   |
| |---------------------------------|                                   |
| | 12-15: Int32 _length (4 bytes)  |                                   |
| |=================================|                                   |
|-----------------------------------------------------------------------|
| 248-263: IPPacketInformation _receiveMessageFromPacketInfo (16 bytes) |
| |==========================================|                          |
| |   0-7: IPAddress _address (8 bytes)      |                          |
| |------------------------------------------|                          |
| |  8-11: Int32 _networkInterface (4 bytes) |                          |
| |------------------------------------------|                          |
| | 12-15: padding (4 bytes)                 |                          |
| |==========================================|                          |
|-----------------------------------------------------------------------|
| 264-287: MemoryHandle _singleBufferHandle (24 bytes)                  |
| |======================================|                              |
| |   0-7: IPinnable _pinnable (8 bytes) |                              |
| |--------------------------------------|                              |
| |  8-15: Void* _pointer (8 bytes)      |                              |
| |--------------------------------------|                              |
| | 16-23: GCHandle _handle (8 bytes)    |                              |
| |======================================|                              |
|-----------------------------------------------------------------------|
| 288-295: GCHandle _wsaMessageBufferGCHandle (8 bytes)                 |
|-----------------------------------------------------------------------|
| 296-303: GCHandle _controlBufferGCHandle (8 bytes)                    |
|-----------------------------------------------------------------------|
| 304-311: GCHandle _wsaRecvMsgWSABufferArrayGCHandle (8 bytes)         |
|-----------------------------------------------------------------------|
| 312-319: GCHandle _socketAddressGCHandle (8 bytes)                    |
|-----------------------------------------------------------------------|
| 320-327: PipeScheduler _ioScheduler (8 bytes)                         |
|-----------------------------------------------------------------------|
| 328-335: Action _callback (8 bytes)                                   |
|=======================================================================|

@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants