Граф коммитов

10 Коммитов

Автор SHA1 Сообщение Дата
Max Gortman 60feb3c4d4 Reformatting redis and proto buf codecs and UDP transport code. (#177) 2016-12-01 17:20:05 -08:00
Max Gortman f31c02e346 Fixes TlsHandler from operation, perf and compat POVs.
Motivation:
TlsHandler
Fix TlsHandler, optimize encryption / decryption wrt Write vs Flush semantics, optimize memory retention for sparse communication, adopt IByteBuffer.GetIoBuffers() in TlsHandler.

Modifications:
- TlsHandler is rewritten to use batch->copy->write approach instead of writing directly to SslStream in order to reduce overhead of framing / writing out everything separately.
- TlsHandler uses IByteBuffer.GetIoBuffers intead of direct array access increasing compatibility for non-array-backed buffers.
- TlsHandler and TlsHandler.MediationStream use Task semantics now when reading through SslStream.
- Extra: upgraded to NBench 2.2, xUnit 2.1.0.
- Extra: better portability for .NET Core support.

Result:
TlsHandler provides better framing and much better (x2+) performance (depends on application control of flushing).
TlsHandler operates properly in edge cases when more than one frame is accepted at once and if decrypted frame size is more than 4 KB.
TlsHandler holds only 256 byte buffer while waiting for more data to arrive off the wire.
Extra: DotNetty is almost .NET Core compatible.
2016-06-01 14:09:14 -07:00
mgortman cef1295c3c PooledByteBufferAllocator port, Byte Buffers improvements
Motivation:
Existing rudimentary buffer pool implementation is not flexible to efficiently support scenarios with high variety in message sizes.

Modifications:
- implemented PooledByteBufferAllocator (port of PooledByteBufAllocator) and related artifacts
- made IByteBuffer implement IEquatable<IByteBuffer>, IComparable<IByteBuffer>, implemented Equals, GetHashCode.
- ported test suite for Byte Buffers and fixed discovered issues.
- added suppression of ExecutionContext flow on async read / write on socket-based channels.
- removed old pooled Byte Buffer allocator implementation.

Result:
Support for buffer pooling for larger byte sequences, more efficient usage of memory dedicated for the pool.
2016-05-05 17:40:07 -07:00
Max Gortman 47163fde8d switching to C# 6.0 2016-05-05 01:19:49 -07:00
mgortman 72888b9a64 Porting resource leak detection
Motivation:
Leak of IReferenceCounted resources is a very common issue while
developing with DotNetty (both codecs and higher level applications).
Having leak detection helps identifying and resolving this kind of issues.

Modifications:
- Added ResourceLeakDetector
- Added leak-aware Byte Buffer implementations

extras
- port of missing Byte Buffer methods
- fixing minor issues with previous PRs

Result:
Simple leak detection is enabled by default on PooledByteBufferAllocator,
leaks are reported through internal logger, advanced leak detection is
available via LeakResourceDetector
2015-11-12 17:12:35 -08:00
mgortman 8b59715deb Improved perf of SingleThreadEventExecutor
Motivation:
Impove performance of execution model

Modifications:
- switched SemaphoreSlim for ManualResetEventSlim to track empty vs non-empty states for executor's queue

extras
- removing wait for event loop shutdown (reduces test run time)
- adding benchmarking
- extracted common test utilities into Tests.Common project
- fixing ReSharper settings for ReSharper 10

Results:
5x improvement on in-loop scheduling, 2x improvement on out-of-liio scheduling:
STEE in loop (new)
        624ms   1,406,159Kc (G0= 114, G1=   0, G2=   0)
STEE in loop (old)
      2,719ms   6,205,423Kc (G0= 114, G1=   0, G2=   0)
STEE out of loop (new)
      1,464ms   6,559,838Kc (G0=  95, G1=   0, G2=   0)
STEE out of loop (old)
      3,869ms  12,331,986Kc (G0=  38, G1=  28, G2=   3)
2015-11-09 04:30:42 -08:00
mgortman 0722ade2a8 Motivation:
enable netty's internal logging experience to ease porting efforts and streamline logging configuration

Modifications:
- ported over InternalLogger and InternalLoggerFactory
- implemented InternalLogger using EventSource
- switched existing internal logging to this (increasing parity with netty)
- added logging configuration in Echo example
- added log to xunit output to end-to-end tests

*** extras
- fixed Echo client to send back received message (not 0 bytes)
- MqttDecoder no longer closes the Channel by itself instead changing internal state to invalid and forwarding an exception.
- further fix to ReSharper's code cleanup settings to properly arrange scope modifiers

Result:
internal components can use familiar experience to perform logging, e.g. `static readonly IInternalLogger Logger = InternalLoggerFactory.GetInstance<AbstractChannel>();`
2015-10-26 02:42:55 -07:00
mgortman 99814c7133 Align ReSharper code style settings with project's code style
Motivation:
help contributors to write/format code in a consistent style adopted by the project

Modifications:
Added settings for implicit private visibility on type members and internal visibility on types.

Result:
contributors can apply code formatting which will remove redundant visibility keywords according to code style.
2015-10-13 00:09:08 -07:00
mgortman 921c6aab9e ChannelHandlerAdapter: virtual + impl deregister
Correctly placed "virtual", implemented default DeregisterAsync behavior.
Minor tweaks to ReSharper settings.
2015-08-06 18:11:42 -07:00
mgortman b9336e0817 first commit 2015-07-16 01:41:06 -07:00