Commit Graph

54 Commits

Author SHA1 Message Date
Ben Adams 8a3516284e Add GetMessageBytes to IHubProtocol (#1915) 2018-04-10 07:14:09 -07:00
James Newton-King bd78785f8d
Minor DefaultHubLifetimeManager improvements (#1904) 2018-04-09 12:31:14 +12:00
James Newton-King 27d18578d0
Use expression body properties and implicit arrays where possible (#1906) 2018-04-08 21:40:01 +12:00
James Newton-King 0f663cadc4
readonly all the things (#1901) 2018-04-08 15:47:01 +12:00
David Fowler c1049b722d
The grand unification of ConnectionContext (#1895)
This change rationalizes the 2 very similar abstractions that exist in Connections.Abstractions, IConnection and ConnectionContext. It also introduces an IConnectionFactory to SignalR that is used to create a new ConnectionContext for a HubConnection.

- HubConnection just completes both ends of the transport pipe instead of calling DisposeAsync.
- Implemented ConnectionContext on HttpConnection and added HttpConnectionFactory
-  Updated tests
2018-04-07 16:19:01 -07:00
David Fowler 86083c0302
Removing native support for IObservable<T> (#1890)
- There are too many issues and questions with respect to back pressure and the buffering policy we should use when the client being streamed to can't support the data being pushed via OnNext.
As a result, we're dropping support for IObservable but keeping ChannelReader and we'll eventually support IAsyncEnumerable when that makes it into the BCL.
- Add sample showing Observable -> ChannelReader adaption
2018-04-07 15:10:39 -07:00
James Newton-King acc0b7ad0d
Serialize NegotiateResponse with IBufferWriter (#1881) 2018-04-07 15:50:13 +12:00
Andrew Stanton-Nurse a29b8ae396
fix #1874 by adding RedisProtocolBenchmark (#1875) 2018-04-05 17:47:41 -07:00
Andrew Stanton-Nurse 19b2fea0d8
Preserialize for all formats when sending through Redis (#1843) 2018-04-05 13:48:14 -07:00
James Newton-King e9db9e64c7
Add streaming benchmarks (#1854) 2018-04-05 20:27:37 +12:00
James Newton-King f7fc2647de
var all the things (#1855) 2018-04-05 18:41:13 +12:00
James Newton-King 6b76d1355e
Add SendAsyncGroup to broadcast benchmarks (#1852) 2018-04-05 14:58:00 +12:00
James Newton-King e7b84b753b
Refactor HubConnectionBuilder (#1830) 2018-04-04 21:19:13 +12:00
BrennanConroy 5ce672dfe6
ThreadStatic MemoryBufferWriter (#1821) 2018-04-02 11:25:04 -07:00
David Fowler 82bda4a9c8
Added micro benchmarks for SSE parsing and Writing (#1818) 2018-04-01 09:19:07 -07:00
BrennanConroy 903a9ea6a0
Use IBufferWriter in IHubProtocol (#1791) 2018-03-30 17:30:08 -07:00
Andrew Stanton-Nurse 6b3a27e73c
Bedrock Renames (#1777) 2018-03-30 15:09:19 -07:00
BrennanConroy 44b667b3e6
Add detailed error option (#1763) 2018-03-30 11:30:07 -07:00
James Newton-King cddf46c0cd
Make HubConnection write messages directly to the PipeWriter (#1762) 2018-03-29 20:26:09 +13:00
James Newton-King 7f86b92f7e
Handshake and negotiation optimization (#1731) 2018-03-29 17:50:45 +13:00
James Newton-King 8c84518ecc
Message writing optimization (#1683) 2018-03-29 11:03:40 +13:00
David Fowler 19b9dca268
Change IHubProtocol interface to support partial parsing (#1745)
- These are the finishing touches before we disable batching on the
C# client and on the server. We're changing the IHubProtocol interface to
modify the input buffer with what was consumed. We're also changing it
to parse a single message at a time to be match what output writing does.
- Added TryParseResponseMessage and made it look like TryParseRequestMessage
2018-03-28 12:08:16 -07:00
David Fowler 7a9160f3e0
React to https://github.com/aspnet/KestrelHttpServer/pull/2428 (#1734) 2018-03-27 02:02:29 -07:00
David Fowler ddc0e4fb3a
Run benchmarks on .NET Core 2.1 (#1722)
- Spoiler alert, it's much faster for the ones I ran at least
2018-03-25 21:07:17 -07:00
David Fowler cb05ce4e0b
Progress towards deleting Sockets.Abstractions (#1705)
* Progress towards deleting Sockets.Abstractions
- Moved our custom DefaultConnectionContext to Sockets.Http and renamed it to HttpConnectionContext.
- Renamed ConnectionManager to HttpConnectionManager
- Use DefaultConnection in tests and benchmarks
- Delete ConnectionMetadata
2018-03-24 04:21:47 -07:00
David Fowler 2e63e5afe3
The rename games part 1 of many (#1696)
- React to rename of EndPoint to ConnectionHandler
- Rename UseSockets to UseConnections
- Rename MapEndPoint to MapConnectionHandler
- Rename HttpSocketOptions to HttpConnectionOptions
2018-03-22 22:35:55 -07:00
BrennanConroy a47e1051e8
Add protocol version to handshake (#1666) 2018-03-22 15:54:35 -07:00
David Fowler 6583e5fb47
Improved allocations and throughput for broadcast scenarios (#1660)
- Don't allocate when enumerating connections
- Don't allocate tasks unless we truly go async
- Don't get the timestamp, just write the pings always (if there's no ongoing write)
- Track the time since last keep alive write instead of the last write
- ValueTask all the things!
- Renamed HubConnectionList to HubConnectionStore
2018-03-21 09:03:36 -07:00
David Fowler cf7c8629ff
Use ActivatorUtlities.CreateFactory instead of CreateInstance (#1643)
* Use ActivatorUtlities.CreateFactory instead of CreateInstance
- Turns out CreateFactory is much much faster
- Added a benchmark for hub activation
2018-03-19 00:19:54 -07:00
David Fowler b792fcb4ef
Reduce the per message read allocations (#1635)
- Introduced Utf8BufferTextReader that writes buffers directly into
the char[] allocated by JSON.NET when reading via the JsonReader.
- Use IArrayPool implementation over ArrayPool<char> when reading
incomming messages.
- Replaced JToken parsing with manual parsing using JsonTextReader.
- Added tests for parsing incoming JSON messages with out of order
properties.
- Make access to message headers lazy
- Changed IHubProtocol.TryParseMessage to be ReadOnlyMemory<byte> instead of ReadOnlySpan<byte>
2018-03-18 15:16:03 -07:00
BrennanConroy db0dc0f960
Ignore writeasync failures when sending to multiple connections (#1589) 2018-03-16 16:48:05 -07:00
BrennanConroy 0e38ee3e63
Create connectionIds using RNGCrypto (#1606) 2018-03-16 16:16:34 -07:00
David Fowler 6a8ede0770
Further making Microsoft.AspNetCore.Sockets "not a thing" (#1599)
- This PR attempts to move things where they are needed instead of where they
happened to be used. As a result we should now have Sockets.Abstractions and
Sockets down to the minimal set of things required to make them run.
Sockets.Abstractions should go away in favor of Protocol.Abstractions and
Sockets contains the EndPoint abstraction and related types.
- Moved ConnectionManager and friends to
Sockets.Http.
-Removed Sockets and moved everything into Sockets.Abstractions.
- Moved DefaultConnection and put it in Sockets.Abstractions.
2018-03-14 15:37:24 -07:00
Andrew Stanton-Nurse fb6121399c
Remove support for binary over SSE and add transfer format to negotiation (#1564) 2018-03-13 14:29:32 -07:00
James Newton-King 974eb28b8b
Hub method reflection caching and invocation benchmarks (#1574) 2018-03-13 10:30:45 +13:00
Andrew Stanton-Nurse 6a2d41cc9f
Fix #924 by introducing HubDispatcher abstraction (#1479) 2018-02-22 20:59:34 -08:00
David Fowler c8d4cf689f
Tackling some low hanging performance fruit (#1470)
* Tackling some low hanging performance fruit
- Use native Memory/Span APIs on Stream and WebSocket in .NET Core 2.1
- Remove double copying in formatters
- Implemented custom HttpContent over ReadOnlyBuffer<byte>
2018-02-20 13:50:31 -08:00
David Fowler e1bb2215e5
Remove the Channel<HubMessage> from the HubConnectionContext (#1468)
* Remove the Channel<HubMessage> from the HubConnectionContext
- Replace the channel with a single lock around the pipewriter. Since writes are always synchronous, the lock is held for a very short time.
- We were only using them in this scenario for handling multiple producers (the hub output, the keep alive ping and the broadcast).
- Handle the scenario where there's back pressure (when we use pipes that are bounded) and give callers a single task representing when back pressure is released.
- Handle synchronous exceptions in RedisHubLifetimeManager
- Fixed benchmarks
2018-02-17 10:22:11 -08:00
David Fowler 28439d1441
Initial changes to move to pipelines (#1424)
- Change the Sockets abstraction from Channel<byte[]> to pipelines.

#615
2018-02-09 17:45:21 -08:00
BrennanConroy d38764a8f0
Rename InvokeAsync to SendAsync on the server (#1312) 2018-01-19 11:32:50 -08:00
Andrew Stanton-Nurse 144984e599
Split MsgPack into separate assembly (#1274) 2018-01-10 14:20:57 -08:00
Mikael Mengistu 6baee8b7a9
Refactor HubContext to not Implement IHubClients (#1262) 2018-01-02 17:26:10 -08:00
Pavel Krymets f08311f337
Use new common benchmark config (#1251) 2017-12-22 14:31:54 -08:00
Andrew Stanton-Nurse 00a6dc983a
Fix #1170 by removing invocationId from non-blocking calls (#1218) 2017-12-19 10:40:58 -08:00
Andrew Stanton-Nurse c1d2024864
Implement #1156 by having the server send Ping messages (#1161) 2017-12-04 14:43:27 -08:00
BrennanConroy e81746c3b6
Reference Task.Extensions directly 2017-11-29 09:14:37 -08:00
BrennanConroy 531c7cfba1
More micro benchmarks (#1158)
- Hub Protocol benchmark
- Broadcast benchmark
- Run benchmarks validation during builds
2017-11-28 15:39:58 -08:00
BrennanConroy 2fcf3ea9b7
Revert benchmarks to netcoreapp2.0 2017-11-16 14:07:39 -08:00
Pranav K 439f2a7892 Update samples and tests to target netcoreapp2.1 2017-11-16 13:38:46 -08:00
Pawel Kadluczka 379160707f
Switching to new base64 APIs (#1127) 2017-11-16 09:20:40 -08:00