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

Introduce experimental/unstable extension traits #5163

Merged
merged 8 commits into from
Sep 18, 2024
Merged

Conversation

indietyp
Copy link
Member

🌟 What is the purpose of this PR?

This implements an experimental set of traits to be used to collecting reports in a fail slow manner these include:

  • TryReportIteratorExt
  • ResultMultiExt (I don't like that name at all)
  • TryReportTupleExt
  • TryReportStreamExt (gated behind the stream flag)

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • modifies a Cargo-publishable library, but it is not yet ready to publish

📜 Does this require a change to the docs?

The changes in this PR:

  • require changes to docs which are made as part of this PR

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • do not affect the execution graph

@github-actions github-actions bot added area/deps Relates to third-party dependencies (area) area/libs > error-stack Affects the `error-stack` crate (library) area/libs Relates to first-party libraries/crates/packages (area) labels Sep 17, 2024
@indietyp indietyp force-pushed the bm/error-stack/folding branch from ce8560d to b185637 Compare September 17, 2024 15:50
Copy link

codecov bot commented Sep 17, 2024

Codecov Report

Attention: Patch coverage is 93.44978% with 15 lines in your changes missing coverage. Please review.

Project coverage is 19.17%. Comparing base (d131383) to head (63b5ef1).
Report is 461 commits behind head on main.

Files with missing lines Patch % Lines
libs/error-stack/experimental/src/stream.rs 92.77% 6 Missing ⚠️
libs/error-stack/experimental/src/tuple.rs 85.71% 5 Missing ⚠️
libs/error-stack/experimental/src/result.rs 86.36% 3 Missing ⚠️
libs/error-stack/experimental/src/iter.rs 98.83% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5163      +/-   ##
==========================================
+ Coverage   18.12%   19.17%   +1.04%     
==========================================
  Files         506      510       +4     
  Lines       16776    17005     +229     
  Branches     2546     2546              
==========================================
+ Hits         3041     3261     +220     
- Misses      13723    13732       +9     
  Partials       12       12              
Flag Coverage Δ
rust.error-stack 72.18% <93.44%> (+2.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

Benchmark results

@rust/graph-benches – Integrations

scaling_read_entity_complete_one_depth

Function Value Mean Flame graphs
entity_by_id 10 entities $$50.4 \mathrm{ms} \pm 1.44 \mathrm{ms}\left({\color{gray}-1.815 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 50 entities $$271 \mathrm{ms} \pm 2.20 \mathrm{ms}\left({\color{lightgreen}-82.688 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$20.0 \mathrm{ms} \pm 95.8 \mathrm{μs}\left({\color{gray}-0.653 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 25 entities $$74.0 \mathrm{ms} \pm 413 \mathrm{μs}\left({\color{gray}2.00 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 5 entities $$25.4 \mathrm{ms} \pm 283 \mathrm{μs}\left({\color{gray}1.24 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_complete_zero_depth

Function Value Mean Flame graphs
entity_by_id 10 entities $$2.11 \mathrm{ms} \pm 19.0 \mathrm{μs}\left({\color{gray}4.63 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 50 entities $$4.12 \mathrm{ms} \pm 23.7 \mathrm{μs}\left({\color{gray}2.16 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$1.91 \mathrm{ms} \pm 12.6 \mathrm{μs}\left({\color{gray}1.13 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 25 entities $$2.78 \mathrm{ms} \pm 80.0 \mathrm{μs}\left({\color{red}8.38 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 5 entities $$1.93 \mathrm{ms} \pm 9.59 \mathrm{μs}\left({\color{gray}0.233 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_linkless

Function Value Mean Flame graphs
entity_by_id 10 entities $$1.91 \mathrm{ms} \pm 9.33 \mathrm{μs}\left({\color{gray}0.567 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$2.04 \mathrm{ms} \pm 8.41 \mathrm{μs}\left({\color{gray}0.182 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$2.80 \mathrm{ms} \pm 16.1 \mathrm{μs}\left({\color{lightgreen}-8.922 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$1.88 \mathrm{ms} \pm 7.49 \mathrm{μs}\left({\color{gray}0.291 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$13.5 \mathrm{ms} \pm 143 \mathrm{μs}\left({\color{gray}2.13 \mathrm{\%}}\right) $$ Flame Graph

representative_read_entity_type

Function Value Mean Flame graphs
get_entity_type_by_id Account ID: d4e16033-c281-4cde-aa35-9085bf2e7579 $$1.41 \mathrm{ms} \pm 6.32 \mathrm{μs}\left({\color{gray}0.074 \mathrm{\%}}\right) $$ Flame Graph

representative_read_entity

Function Value Mean Flame graphs
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$17.4 \mathrm{ms} \pm 230 \mathrm{μs}\left({\color{gray}2.62 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$16.6 \mathrm{ms} \pm 235 \mathrm{μs}\left({\color{gray}0.077 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$15.9 \mathrm{ms} \pm 164 \mathrm{μs}\left({\color{gray}-3.056 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$15.8 \mathrm{ms} \pm 139 \mathrm{μs}\left({\color{gray}-2.924 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$16.8 \mathrm{ms} \pm 258 \mathrm{μs}\left({\color{gray}3.60 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$16.2 \mathrm{ms} \pm 228 \mathrm{μs}\left({\color{gray}-0.262 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$15.8 \mathrm{ms} \pm 236 \mathrm{μs}\left({\color{gray}1.03 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$16.5 \mathrm{ms} \pm 222 \mathrm{μs}\left({\color{lightgreen}-21.496 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/block/v/1 $$16.4 \mathrm{ms} \pm 181 \mathrm{μs}\left({\color{gray}4.23 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
link_by_source_by_property depths: DT=2, PT=2, ET=2, E=2 $$102 \mathrm{ms} \pm 613 \mathrm{μs}\left({\color{gray}1.68 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=0, E=2 $$82.0 \mathrm{ms} \pm 470 \mathrm{μs}\left({\color{gray}1.51 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=0, E=0 $$43.7 \mathrm{ms} \pm 268 \mathrm{μs}\left({\color{gray}1.16 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=2, E=2 $$93.2 \mathrm{ms} \pm 547 \mathrm{μs}\left({\color{gray}2.57 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=2, ET=2, E=2 $$97.6 \mathrm{ms} \pm 559 \mathrm{μs}\left({\color{gray}1.22 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=255, PT=255, ET=255, E=255 $$109 \mathrm{ms} \pm 645 \mathrm{μs}\left({\color{gray}-0.038 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=2, PT=2, ET=2, E=2 $$59.9 \mathrm{ms} \pm 306 \mathrm{μs}\left({\color{gray}-0.445 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=0, E=2 $$45.0 \mathrm{ms} \pm 492 \mathrm{μs}\left({\color{gray}2.37 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=0, E=0 $$40.6 \mathrm{ms} \pm 322 \mathrm{μs}\left({\color{gray}0.616 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=2, E=2 $$51.1 \mathrm{ms} \pm 324 \mathrm{μs}\left({\color{gray}0.491 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=2, ET=2, E=2 $$55.2 \mathrm{ms} \pm 296 \mathrm{μs}\left({\color{gray}-0.272 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=255, PT=255, ET=255, E=255 $$67.6 \mathrm{ms} \pm 366 \mathrm{μs}\left({\color{gray}-0.666 \mathrm{\%}}\right) $$ Flame Graph

@indietyp indietyp added this pull request to the merge queue Sep 18, 2024
Merged via the queue into main with commit c10c964 Sep 18, 2024
158 checks passed
@indietyp indietyp deleted the bm/error-stack/folding branch September 18, 2024 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/deps Relates to third-party dependencies (area) area/libs > error-stack Affects the `error-stack` crate (library) area/libs Relates to first-party libraries/crates/packages (area)
Development

Successfully merging this pull request may close these issues.

2 participants