Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Lazy iter #112

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

JonathanWoollett-Light
Copy link
Contributor

@JonathanWoollett-Light JonathanWoollett-Light commented Jun 14, 2023

Summary of the PR

wait now returns an iterator that allows lazily evaluating event closures. This allows for returning an error when the 1st closure returns an error, rather than always needing to evaluate every closure.

Benchmarks

process_basic           time:   [9.8147 µs 9.8172 µs 9.8200 µs]
                        change: [-26.640% -26.587% -26.539%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 14 outliers among 200 measurements (7.00%)
  1 (0.50%) low mild
  3 (1.50%) high mild
  10 (5.00%) high severe

process_with_arc_mutex  time:   [12.021 µs 12.028 µs 12.035 µs]
                        change: [-10.332% -10.228% -10.105%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 14 outliers among 200 measurements (7.00%)
  8 (4.00%) high mild
  6 (3.00%) high severe

process_with_inner_mut  time:   [10.447 µs 10.453 µs 10.459 µs]
                        change: [-18.906% -18.843% -18.762%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 8 outliers among 200 measurements (4.00%)
  5 (2.50%) high mild
  3 (1.50%) high severe

process_dynamic_dispatch
                        time:   [20.935 µs 20.943 µs 20.951 µs]
                        change: [+13.610% +13.720% +13.836%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 10 outliers among 200 measurements (5.00%)
  6 (3.00%) high mild
  4 (2.00%) high severe

process_dispatch_few_events
                        time:   [555.07 ns 555.70 ns 556.37 ns]
                        change: [-22.108% -22.014% -21.925%] (p = 0.00 < 0.05)
                        Performance has improved.

Requirements

Before submitting your PR, please make sure you addressed the following
requirements:

  • All commits in this PR are signed (with git commit -s), and the commit
    message has max 60 characters for the summary and max 75 characters for each
    description line.
  • All added/changed functionality has a corresponding unit/integration
    test.
  • All added/changed public-facing functionality has entries in the "Upcoming
    Release" section of CHANGELOG.md (if no such section exists, please create one).
  • Any newly added unsafe code is properly documented.

Jonathan Woollett-Light added 3 commits July 14, 2023 11:54
Signed-off-by: Jonathan Woollett-Light <[email protected]>
Allowing a return value for the event closures among many things allows for proper error propagation.

Signed-off-by: Jonathan Woollett-Light <[email protected]>
`wait` now returns an iterator that allows lazily evaluating event closures. This allows for returning an error when the 1st closure returns an error, rather than always needing to evaluate every closure.

Signed-off-by: Jonathan Woollett-Light <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant