swift-nio/Sources/NIOPerformanceTester
David Nadoba e0cc6dd6ff
Throw `CancellationError` instead of returning `nil` during early cancellation. (#2401)
### Motivation:
Follow up PR for https://github.com/apple/swift-nio/pull/2399

We currently still return `nil` if the current `Task` is canceled before the first call to `NIOThrowingAsyncSequenceProducer.AsyncIterator.next()` but it should throw `CancellationError` too.

In addition, the generic `Failure` type turns out to be a problem. Just throwing a `CancellationError` without checking that `Failure` type is `any Swift.Error` or `CancellationError` introduced a type safety violation as we throw an unrelated type.

### Modifications:

- throw `CancellationError` on eager cancellation
-  deprecates the generic `Failure` type of `NIOThrowingAsyncSequenceProducer`. It now must always be `any Swift.Error`. For backward compatibility we will still return nil if `Failure` is not `any Swift.Error` or `CancellationError`.

### Result:

`CancellationError` is now correctly thrown instead of returning `nil` on eager cancelation. Generic `Failure` type is deprecated.
2023-04-11 08:58:01 -07:00
..
Benchmark.swift Remove `#if compiler(>=5.5)` (#2292) 2022-10-13 07:17:46 -07:00
ByteBufferViewContainsBenchmark.swift Add benchmark for BBV contains. (#1385) (#2042) 2022-02-08 22:06:21 -08:00
ByteBufferViewCopyToArrayBenchmark.swift Add benchmarks for copying BBV to Array. (#2037) 2022-02-03 01:36:12 -08:00
ByteBufferViewIteratorBenchmark.swift Clean up dependencies and imports. (#1935) 2021-08-12 13:49:46 +01:00
ByteBufferWriteMultipleBenchmarks.swift ByteBuffer: provide multi read/write int methods (#1987) 2021-11-22 14:58:52 +00:00
ByteToMessageDecoderDecodeManySmallsBenchmark.swift Clean up dependencies and imports. (#1935) 2021-08-12 13:49:46 +01:00
ChannelPipelineBenchmark.swift Increase runtime of performance tests to O(10 ms) to increase SNR (#2063) 2022-03-24 07:42:24 -07:00
CircularBufferCopyToArrayBenchmark.swift Add benchmarks for copying CircularBuffer to Array (#2058) 2022-03-07 08:39:28 -08:00
CircularBufferIntoByteBufferBenchmark.swift Clean up dependencies and imports. (#1935) 2021-08-12 13:49:46 +01:00
DeadlineNowBenchmark.swift NIOPerformanceTester: Add DeadlineNowBenchmark for NIODeadline.now() (#2117) 2022-05-16 19:21:31 +01:00
ExecuteBenchmark.swift Increase runtime of performance tests to O(10 ms) to increase SNR (#2063) 2022-03-24 07:42:24 -07:00
LockBenchmark.swift rename class Lock to struct NIOLock (#2266) 2022-09-21 07:36:42 -07:00
NIOAsyncSequenceProducerBenchmark.swift Throw `CancellationError` instead of returning `nil` during early cancellation. (#2401) 2023-04-11 08:58:01 -07:00
NIOAsyncWriterSingleWritesBenchmark.swift Add benchmarks for `NIOAsyncWriter` and `NIOAsyncSequenceProducer` (#2301) 2022-10-26 03:51:20 -07:00
SchedulingAndRunningBenchmark.swift Increase runtime of performance tests to O(10 ms) to increase SNR (#2063) 2022-03-24 07:42:24 -07:00
SchedulingBenchmark.swift Increase runtime of performance tests to O(10 ms) to increase SNR (#2063) 2022-03-24 07:42:24 -07:00
TCPThroughputBenchmark.swift Add availability requirements to TCPThroughputBenchmark (#2368) 2023-02-16 11:55:14 +00:00
UDPBenchmark.swift Add UDP performance tests (#2360) 2023-02-06 15:50:47 +00:00
WebSocketFrameDecoderBenchmark.swift Clean up dependencies and imports. (#1935) 2021-08-12 13:49:46 +01:00
WebSocketFrameEncoderBenchmark.swift Clean up dependencies and imports. (#1935) 2021-08-12 13:49:46 +01:00
main.swift Building swift-nio with Swift 5.7 for iOS using Xcode 14.0 at 2.48.0. (#2369) 2023-02-17 10:05:43 -08:00
resources.swift add performance tester (#396) 2018-05-11 07:22:24 +02:00