Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⚡️ Faster scheduling of
scheduleSequence
(#5614)
**Description** <!-- Please provide a short description and potentially linked issues justifying the need for this PR --> With #3891, our target is to make scheduling faster. Scheduling is one of the built-in arbitrary provided by fast-check. It aims to ease detection of race-conditions by offering a simple way to detect such issues in your code. Up-to-now the code was doing a bit too many await/then letting it give back the hand many times in a row while it could have been faster to take it back. Additionally, this past behaviour (that we are trying to fix with many PRs) used to be strange as awaiting 1 was ok, but 10-times was not. More precisely there was a number of await working and passed this number it stopped to work as usual and users started to need to use other approaches (drop the `waitAll`). This set of PRs not only addresses a potential perf concern but also clarify what should work so that it appears more determistic for the final users. <!-- * Your PR is fixing a bug or regression? Check for existing issues related to this bug and link them --> <!-- * Your PR is adding a new feature? Make sure there is a related issue or discussion attached to it --> <!-- You can provide any additional context to help into understanding what's this PR is attempting to solve: reproduction of a bug, code snippets... --> **Checklist** — _Don't delete this checklist and make sure you do the following before opening the PR_ - [x] The name of my PR follows [gitmoji](https://gitmoji.dev/) specification - [x] My PR references one of several related issues (if any) - [x] New features or breaking changes must come with an associated Issue or Discussion - [x] My PR does not add any new dependency without an associated Issue or Discussion - [x] My PR includes bumps details, please run `yarn bump` and flag the impacts properly - [x] My PR adds relevant tests and they would have failed without my PR (when applicable) <!-- More about contributing at https://github.com/dubzzz/fast-check/blob/main/CONTRIBUTING.md --> **Advanced** <!-- How to fill the advanced section is detailed below! --> **👀 Potentially risky** (risk: low): Our scheduler implementation was not as fast as it was supposed to be. As such it accepted some intermediate frames to be issued in-between two executions possibly making some behavior looking buggy when users started to happen yet an extra awaiting thing in the loop. <!-- [Category] Please use one of the categories below, it will help us into better understanding the urgency of the PR --> <!-- * ✨ Introduce new features --> <!-- * 📝 Add or update documentation --> <!-- * ✅ Add or update tests --> <!-- * 🐛 Fix a bug --> <!-- * 🏷️ Add or update types --> <!-- * ⚡️ Improve performance --> <!-- * _Other(s):_ ... --> <!-- [Impacts] Please provide a comma separated list of the potential impacts that might be introduced by this change --> <!-- * Generated values: Can your change impact any of the existing generators in terms of generated values, if so which ones? when? --> <!-- * Shrink values: Can your change impact any of the existing generators in terms of shrink values, if so which ones? when? --> <!-- * Performance: Can it require some typings changes on user side? Please give more details --> <!-- * Typings: Is there a potential performance impact? In which cases? -->
- Loading branch information