14 Commits
Author SHA1 Message Date
Franz Busch d5b49aab17 Apply formatting 2025-03-28 21:59:41 +01:00
Philippe Hausler e639e5c889 Ensure tests work in deployments that host as swift 5.7 (#285) 2023-08-15 15:40:57 -07:00
Franz Busch 7ac31f979f Fix more Sendable warnings and flaky test (#281)
# Motivation
We still had some `Sendable` warnings left under strict Concurrency checking.

# Modification
This PR fixes a bunch of `Sendable` warnings but we still have some left in the validation tests. Additionally, I fixed a flaky test.
2023-08-01 16:09:34 +01:00
Thibault Wittemberg 9cfed92b02 buffer: implement with custom storages (#239) 2023-02-10 11:27:06 -08:00
Thibault Wittemberg 0ebc8058fc channel: re-implement with a state machine (#235) 2023-01-12 09:40:37 -08:00
Thibault Wittemberg dd97b564ae tests: harmonize debounce availability (#223) 2022-11-16 10:19:45 -08:00
Philippe Hausler 0174f58455 Cleanup Sendable conformances and @preconcurrency imports to build as strict concurrency clean (#230) 2022-11-16 10:15:26 -08:00
Franz Busch f05e450f0b Remove AsyncIterator: Sendable requirement from debounce (#198)
* Remove `AsyncIterator: Sendable` requirement from debounce

# Motivation
The current implementation of `AsyncDebounceSequence` requires the base `AsyncIterator` to be `Sendable`. This is causing two problems:

1. It only allows users to use `debounce` if their `AsyncSequence.AsyncIterator` is `Sendable`
2. In `debounce` we are creating a lot of new `Task`s and reating `Task`s is not cheap.

My main goal of this PR was to remove the `Sendable` constraint from `debounce`.

# Modification
This PR overhauls the implementation of `debounce` and aligns it with the implementation of the open `merge` PR https://github.com/apple/swift-async-algorithms/pull/185 . The most important changes are this:
- I removed the `Sendable` requirement from the base sequences `AsyncIterator`.
- Instead of creating new Tasks for the sleep and for the upstream consumption. I am now creating one Task and manipulate it by signalling continuations
- I am not cancelling the sleep. Instead I am recalculating the time left to sleep when a sleep finishes.

# Result
In the end, this PR swaps the implementation of `AsyncDebounceSequence` and drops the `Sendable` constraint and passes all tests. Furthermore, on my local performance testing I saw up 150% speed increase in throughput.

* Fix https://github.com/apple/swift-async-algorithms/issues/174

* Code review

* Remove lock methods

* Cleanup some unused code

* Setup task after first call to next
2022-09-30 10:12:11 -07:00
Reza Shirazian 4b5a3ef050 measureSequenceThroughput-duration-clean-up (#125)
duration and start property in measureSequenceThroughput is vestigial from early development. This PR cleans that up.
2022-03-29 09:10:51 -07:00
Reza Shirazian fac138c517 #45 - Two sided performance test for merge (#114)
This PR extends `measureSequenceThroughput` to take two outputs so functions like merge/ zip etc can be tested by both sides.
2022-03-28 17:09:22 -07:00
Philippe Hausler 3447a342ac Get nearly everything up and rolling for linux (#85)
* Get nearly everything up and rolling for linux

* Alter validation diagrams for an internal function to expect failures
2022-03-17 15:14:57 -07:00
Philippe Hausler a52b55c8ac Reduce warnings from preconcurrency issues and unused values (#71) 2022-03-07 12:55:17 -08:00
Philippe Hausler 91aa4a85d4 refine the sample time for throughput measurements so that it does not take so long for the tests (#28) 2022-01-25 14:57:04 -08:00
kperryua 91968fa3e9 AsyncSequence throughput performance tests (#19)
* AsyncSequence throughput performance tests

* Reduce source sequence overhead

* Normalize whitespace

* Added joined() throughput test

* File renaming
2022-01-25 12:07:23 -08:00