v1.0.4
General
- Significant reduction in memory allocations while downloading torrents by replacing
async Task
method declarations withasync ReusableTask
. This is a feature of the https://github.com/alanmcgovern/ReusableTasks project, which is also available on NuGet https://www.nuget.org/packages/ReusableTasks. - The
IConnection
interface has been superseded byIConnection2
. The only difference is that the three main methods, ConnectAsync, SendAsync and ReceiveAsync are now typed asReusableTask
instead ofTask
. If anyone is implementing their own IConnection it is strongly recommended to use IConnection2 so that theReusableTask
variants of the three methods can be used instead of theTask
variants. However, connections which implementIConnection
are still fully supported - Migrated to System.Numeric.BigInteger instead of an old imported copy of Mono's BigInteger class. The System.Numeric version is significantly more performant than then decade old version from Mono.
- Small tweak to how peers connection retries operate. If a connection could be established and an encrypted handshake fails, we immediately retry with an unencrypted handshake, and vice versa. This means connectable peers will have both methods checked immediately, increasing the chance of an active connection being established quickly. Previously the peer would be added to the end of the list and would be retried a long time after the initial attempt.
Performance Data
This screenshot shows the total allocated objects throughout the lifetime of a session which downloaded two torrents, totalling 3.2GB of data. The latest round of optimisations drastically reduced the allocations to 60MB in total.