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-754, H-3333: Move Filter and Subgraph to store crate #5166

Merged
merged 4 commits into from
Sep 18, 2024

Conversation

TimDiekmann
Copy link
Member

🌟 What is the purpose of this PR?

Strictly, they don't belong to the store but they are very related. This simplifies a lot of things. It's required to move them in order to move the store to a more accessible location.

🔍 What does this change?

  • Split QueryRecord and SubgraphRecord (long overdue)
  • Move Filter, Subgraph, and accommodating API to hash-graph-store

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • does not modify any publishable blocks or libraries, or modifications do not need publishing

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

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

The changes in this PR:

  • do not affect the execution graph

indietyp
indietyp previously approved these changes Sep 18, 2024
Copy link
Member

@indietyp indietyp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor non-blocking question, otherwise LGTM

apps/hash-graph/libs/store/src/subgraph/record.rs Outdated Show resolved Hide resolved
Base automatically changed from t/h-3332-move-out-store-definition to main September 18, 2024 08:05
@TimDiekmann TimDiekmann dismissed indietyp’s stale review September 18, 2024 08:05

The base branch was changed.

@TimDiekmann TimDiekmann force-pushed the t/h-3333-move-filter-and-subgraph-to-store-crate branch from 816d40a to 5031b24 Compare September 18, 2024 08:34
@TimDiekmann TimDiekmann marked this pull request as ready for review September 18, 2024 08:35
indietyp
indietyp previously approved these changes Sep 18, 2024
@TimDiekmann
Copy link
Member Author

Sorry, I've overseen a private intra-doc link 🙃

@TimDiekmann TimDiekmann added this pull request to the merge queue Sep 18, 2024
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 $$31.6 \mathrm{ms} \pm 208 \mathrm{μs}\left({\color{lightgreen}-39.184 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 50 entities $$273 \mathrm{ms} \pm 1.60 \mathrm{ms}\left({\color{gray}0.256 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$19.8 \mathrm{ms} \pm 91.7 \mathrm{μs}\left({\color{gray}-1.359 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 25 entities $$73.5 \mathrm{ms} \pm 441 \mathrm{μs}\left({\color{gray}-0.099 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 5 entities $$25.3 \mathrm{ms} \pm 365 \mathrm{μs}\left({\color{gray}2.26 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_complete_zero_depth

Function Value Mean Flame graphs
entity_by_id 10 entities $$2.03 \mathrm{ms} \pm 22.1 \mathrm{μs}\left({\color{gray}-3.501 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 50 entities $$4.03 \mathrm{ms} \pm 24.8 \mathrm{μs}\left({\color{gray}0.329 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$1.87 \mathrm{ms} \pm 7.72 \mathrm{μs}\left({\color{gray}-0.216 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 25 entities $$2.51 \mathrm{ms} \pm 15.9 \mathrm{μs}\left({\color{lightgreen}-15.407 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 5 entities $$1.91 \mathrm{ms} \pm 11.4 \mathrm{μs}\left({\color{gray}0.326 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_linkless

Function Value Mean Flame graphs
entity_by_id 10 entities $$1.87 \mathrm{ms} \pm 8.28 \mathrm{μs}\left({\color{gray}0.060 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$2.02 \mathrm{ms} \pm 9.11 \mathrm{μs}\left({\color{gray}0.371 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$2.76 \mathrm{ms} \pm 11.8 \mathrm{μs}\left({\color{gray}-1.098 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$1.87 \mathrm{ms} \pm 8.82 \mathrm{μs}\left({\color{gray}0.411 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$13.0 \mathrm{ms} \pm 136 \mathrm{μs}\left({\color{gray}-0.492 \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.40 \mathrm{ms} \pm 5.47 \mathrm{μs}\left({\color{gray}-1.932 \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/song/v/1 $$16.2 \mathrm{ms} \pm 208 \mathrm{μs}\left({\color{gray}0.874 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$16.0 \mathrm{ms} \pm 165 \mathrm{μs}\left({\color{gray}-3.553 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$16.6 \mathrm{ms} \pm 205 \mathrm{μs}\left({\color{red}5.24 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$15.6 \mathrm{ms} \pm 191 \mathrm{μs}\left({\color{gray}-3.063 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/block/v/1 $$16.2 \mathrm{ms} \pm 181 \mathrm{μs}\left({\color{lightgreen}-7.937 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$15.4 \mathrm{ms} \pm 172 \mathrm{μs}\left({\color{lightgreen}-5.572 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$14.3 \mathrm{ms} \pm 163 \mathrm{μs}\left({\color{lightgreen}-13.056 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$14.9 \mathrm{ms} \pm 144 \mathrm{μs}\left({\color{lightgreen}-38.916 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$15.3 \mathrm{ms} \pm 168 \mathrm{μs}\left({\color{lightgreen}-5.984 \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 $$101 \mathrm{ms} \pm 635 \mathrm{μs}\left({\color{gray}1.28 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=0, E=2 $$82.1 \mathrm{ms} \pm 392 \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 $$44.0 \mathrm{ms} \pm 340 \mathrm{μs}\left({\color{gray}0.303 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=2, E=2 $$93.5 \mathrm{ms} \pm 407 \mathrm{μs}\left({\color{gray}2.45 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=2, ET=2, E=2 $$97.9 \mathrm{ms} \pm 491 \mathrm{μs}\left({\color{gray}0.925 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=255, PT=255, ET=255, E=255 $$108 \mathrm{ms} \pm 469 \mathrm{μs}\left({\color{gray}0.251 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=2, PT=2, ET=2, E=2 $$59.2 \mathrm{ms} \pm 544 \mathrm{μs}\left({\color{gray}-4.647 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=0, E=2 $$44.4 \mathrm{ms} \pm 263 \mathrm{μs}\left({\color{gray}-1.337 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=0, E=0 $$39.8 \mathrm{ms} \pm 217 \mathrm{μs}\left({\color{gray}-4.673 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=2, E=2 $$50.0 \mathrm{ms} \pm 378 \mathrm{μs}\left({\color{lightgreen}-5.844 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=2, ET=2, E=2 $$56.3 \mathrm{ms} \pm 642 \mathrm{μs}\left({\color{gray}-2.741 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=255, PT=255, ET=255, E=255 $$68.3 \mathrm{ms} \pm 684 \mathrm{μs}\left({\color{gray}-2.292 \mathrm{\%}}\right) $$ Flame Graph

Merged via the queue into main with commit ec92342 Sep 18, 2024
159 checks passed
@TimDiekmann TimDiekmann deleted the t/h-3333-move-filter-and-subgraph-to-store-crate branch September 18, 2024 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/apps > hash* Affects HASH (a `hash-*` app) area/apps > hash-graph area/apps area/deps Relates to third-party dependencies (area) area/tests > integration New or updated integration tests area/tests New or updated tests type/eng > backend Owned by the @backend team
Development

Successfully merging this pull request may close these issues.

2 participants