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

H-3774: Fix including data type children will not emit anything if no children exist #5846

Conversation

TimDiekmann
Copy link
Member

🌟 What is the purpose of this PR?

Currently, if resolveDataTypeWithChildren is set, no data types will be returned if no children exist for the data types.

🔍 What does this change?

Instead of joining the inheritance it additionally selects from it as otherwise it requires that some inheritance exists.

@TimDiekmann TimDiekmann requested a review from CiaranMn December 10, 2024 10:47
@TimDiekmann TimDiekmann self-assigned this Dec 10, 2024
@github-actions github-actions bot added area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team labels Dec 10, 2024
@TimDiekmann TimDiekmann added this pull request to the merge queue Dec 10, 2024
Merged via the queue into main with commit 7db9d72 Dec 10, 2024
86 checks passed
@TimDiekmann TimDiekmann deleted the t/h-3774-fix-resolvedatatypewithchildren-not-returning-data-types-if branch December 10, 2024 11:22
Copy link
Contributor

Benchmark results

@rust/hash-graph-benches – Integrations

representative_read_entity

Function Value Mean Flame graphs
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$17.0 \mathrm{ms} \pm 198 \mathrm{μs}\left({\color{lightgreen}-30.533 \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 185 \mathrm{μs}\left({\color{lightgreen}-9.159 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$17.6 \mathrm{ms} \pm 168 \mathrm{μs}\left({\color{gray}0.929 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$17.4 \mathrm{ms} \pm 185 \mathrm{μs}\left({\color{red}8.18 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/block/v/1 $$16.8 \mathrm{ms} \pm 221 \mathrm{μs}\left({\color{gray}2.18 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$17.4 \mathrm{ms} \pm 224 \mathrm{μs}\left({\color{red}8.11 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$17.0 \mathrm{ms} \pm 240 \mathrm{μs}\left({\color{gray}-2.755 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$17.4 \mathrm{ms} \pm 220 \mathrm{μs}\left({\color{lightgreen}-29.035 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$17.3 \mathrm{ms} \pm 208 \mathrm{μs}\left({\color{gray}3.76 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property depths: DT=255, PT=255, ET=255, E=255 $$67.5 \mathrm{ms} \pm 394 \mathrm{μs}\left({\color{gray}0.922 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=0, E=0 $$38.8 \mathrm{ms} \pm 209 \mathrm{μs}\left({\color{gray}-1.157 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=2, PT=2, ET=2, E=2 $$57.8 \mathrm{ms} \pm 213 \mathrm{μs}\left({\color{gray}0.745 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=0, E=2 $$44.0 \mathrm{ms} \pm 233 \mathrm{μs}\left({\color{gray}1.61 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=2, E=2 $$49.2 \mathrm{ms} \pm 249 \mathrm{μs}\left({\color{gray}-0.228 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=2, ET=2, E=2 $$54.1 \mathrm{ms} \pm 285 \mathrm{μs}\left({\color{gray}1.42 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=255, PT=255, ET=255, E=255 $$109 \mathrm{ms} \pm 488 \mathrm{μs}\left({\color{gray}-2.507 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=0, E=0 $$44.1 \mathrm{ms} \pm 208 \mathrm{μs}\left({\color{gray}-1.823 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=2, PT=2, ET=2, E=2 $$102 \mathrm{ms} \pm 592 \mathrm{μs}\left({\color{gray}-0.559 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=0, E=2 $$83.1 \mathrm{ms} \pm 386 \mathrm{μs}\left({\color{gray}-0.566 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=2, E=2 $$93.8 \mathrm{ms} \pm 434 \mathrm{μs}\left({\color{gray}1.18 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=2, ET=2, E=2 $$96.0 \mathrm{ms} \pm 533 \mathrm{μs}\left({\color{gray}-3.261 \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 5.67 \mathrm{μs}\left({\color{gray}0.772 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_complete_one_depth

Function Value Mean Flame graphs
entity_by_id 50 entities $$277 \mathrm{ms} \pm 1.94 \mathrm{ms}\left({\color{gray}0.884 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 5 entities $$26.9 \mathrm{ms} \pm 184 \mathrm{μs}\left({\color{gray}0.262 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$20.9 \mathrm{ms} \pm 325 \mathrm{μs}\left({\color{gray}2.24 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$57.4 \mathrm{ms} \pm 201 \mathrm{μs}\left({\color{gray}0.068 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 25 entities $$183 \mathrm{ms} \pm 622 \mathrm{μs}\left({\color{gray}1.05 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$1.96 \mathrm{ms} \pm 21.2 \mathrm{μs}\left({\color{gray}0.793 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$2.12 \mathrm{ms} \pm 8.90 \mathrm{μs}\left({\color{gray}0.859 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$1.95 \mathrm{ms} \pm 6.85 \mathrm{μs}\left({\color{gray}-0.394 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$2.85 \mathrm{ms} \pm 12.7 \mathrm{μs}\left({\color{gray}0.179 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$9.19 \mathrm{ms} \pm 85.9 \mathrm{μs}\left({\color{lightgreen}-33.324 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_complete_zero_depth

Function Value Mean Flame graphs
entity_by_id 50 entities $$4.02 \mathrm{ms} \pm 22.7 \mathrm{μs}\left({\color{lightgreen}-5.815 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 5 entities $$1.97 \mathrm{ms} \pm 7.83 \mathrm{μs}\left({\color{gray}-0.178 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$1.93 \mathrm{ms} \pm 5.21 \mathrm{μs}\left({\color{gray}-0.960 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$2.19 \mathrm{ms} \pm 10.2 \mathrm{μs}\left({\color{gray}-1.796 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 25 entities $$3.36 \mathrm{ms} \pm 16.2 \mathrm{μs}\left({\color{gray}-1.952 \mathrm{\%}}\right) $$ Flame Graph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team
Development

Successfully merging this pull request may close these issues.

2 participants