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-4023, H-4024, H-4059: Allow updating multiple ontology types at once #6416

Merged

Conversation

TimDiekmann
Copy link
Member

🌟 What is the purpose of this PR?

We can create multiple types at once but not update them. This adds bulk operations to update ontology types.

@TimDiekmann TimDiekmann self-assigned this Feb 11, 2025
@github-actions github-actions bot added area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team area/tests New or updated tests labels Feb 11, 2025
CiaranMn
CiaranMn previously approved these changes Feb 12, 2025
Copy link
Member

@CiaranMn CiaranMn left a comment

Choose a reason for hiding this comment

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

Tested and working, thanks!

@TimDiekmann TimDiekmann added this pull request to the merge queue Feb 12, 2025
Merged via the queue into main with commit 45035ef Feb 12, 2025
81 checks passed
@TimDiekmann TimDiekmann deleted the t/h-4023-allow-updating-multiple-entity-types-at-once branch February 12, 2025 13:31
Copy link
Contributor

Benchmark results

@rust/hash-graph-benches – Integrations

scaling_read_entity_complete_zero_depth

Function Value Mean Flame graphs
entity_by_id 10 entities $$2.23 \mathrm{ms} \pm 9.03 \mathrm{μs}\left({\color{gray}-1.182 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 25 entities $$3.36 \mathrm{ms} \pm 15.1 \mathrm{μs}\left({\color{gray}-1.968 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 5 entities $$2.02 \mathrm{ms} \pm 8.55 \mathrm{μs}\left({\color{gray}-0.794 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 50 entities $$4.25 \mathrm{ms} \pm 25.3 \mathrm{μs}\left({\color{gray}2.84 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$1.99 \mathrm{ms} \pm 6.75 \mathrm{μs}\left({\color{gray}-0.102 \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 $$16.6 \mathrm{ms} \pm 183 \mathrm{μs}\left({\color{gray}-1.743 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$16.5 \mathrm{ms} \pm 197 \mathrm{μs}\left({\color{gray}1.97 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/block/v/1 $$16.0 \mathrm{ms} \pm 222 \mathrm{μs}\left({\color{lightgreen}-30.085 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$16.1 \mathrm{ms} \pm 182 \mathrm{μs}\left({\color{lightgreen}-29.136 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$17.4 \mathrm{ms} \pm 215 \mathrm{μs}\left({\color{red}8.78 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$16.3 \mathrm{ms} \pm 176 \mathrm{μs}\left({\color{lightgreen}-5.633 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$16.0 \mathrm{ms} \pm 185 \mathrm{μs}\left({\color{lightgreen}-5.739 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$16.5 \mathrm{ms} \pm 222 \mathrm{μs}\left({\color{gray}-2.866 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$16.8 \mathrm{ms} \pm 191 \mathrm{μs}\left({\color{gray}1.74 \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 $$65.9 \mathrm{ms} \pm 198 \mathrm{μs}\left({\color{gray}-0.026 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=0, E=0 $$38.4 \mathrm{ms} \pm 233 \mathrm{μs}\left({\color{gray}0.177 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=2, ET=2, E=2 $$52.8 \mathrm{ms} \pm 258 \mathrm{μs}\left({\color{gray}-0.252 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=2, PT=2, ET=2, E=2 $$56.6 \mathrm{ms} \pm 297 \mathrm{μs}\left({\color{gray}0.482 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=2, E=2 $$49.2 \mathrm{ms} \pm 298 \mathrm{μs}\left({\color{gray}2.18 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=0, E=2 $$46.9 \mathrm{ms} \pm 181 \mathrm{μs}\left({\color{red}9.36 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=255, PT=255, ET=255, E=255 $$98.5 \mathrm{ms} \pm 353 \mathrm{μs}\left({\color{gray}-0.498 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=0, E=0 $$37.8 \mathrm{ms} \pm 230 \mathrm{μs}\left({\color{gray}-0.768 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=2, ET=2, E=2 $$86.3 \mathrm{ms} \pm 450 \mathrm{μs}\left({\color{gray}-0.312 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=2, PT=2, ET=2, E=2 $$89.9 \mathrm{ms} \pm 409 \mathrm{μs}\left({\color{gray}-0.338 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=2, E=2 $$81.7 \mathrm{ms} \pm 338 \mathrm{μs}\left({\color{gray}-0.347 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=0, E=2 $$73.5 \mathrm{ms} \pm 467 \mathrm{μs}\left({\color{gray}0.138 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_complete_one_depth

Function Value Mean Flame graphs
entity_by_id 10 entities $$31.9 \mathrm{ms} \pm 167 \mathrm{μs}\left({\color{lightgreen}-45.059 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 25 entities $$177 \mathrm{ms} \pm 692 \mathrm{μs}\left({\color{gray}-2.709 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 5 entities $$27.1 \mathrm{ms} \pm 136 \mathrm{μs}\left({\color{gray}-0.482 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 50 entities $$5.63 \mathrm{s} \pm 284 \mathrm{ms}\left({\color{red}1950 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$20.8 \mathrm{ms} \pm 82.9 \mathrm{μs}\left({\color{gray}-0.955 \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 $$2.14 \mathrm{ms} \pm 10.2 \mathrm{μs}\left({\color{gray}0.521 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_linkless

Function Value Mean Flame graphs
entity_by_id 100 entities $$2.12 \mathrm{ms} \pm 6.93 \mathrm{μs}\left({\color{gray}-2.321 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$2.01 \mathrm{ms} \pm 9.18 \mathrm{μs}\left({\color{gray}-2.514 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$2.94 \mathrm{ms} \pm 15.1 \mathrm{μs}\left({\color{gray}-4.114 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$9.29 \mathrm{ms} \pm 78.5 \mathrm{μs}\left({\color{lightgreen}-36.668 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$1.99 \mathrm{ms} \pm 8.07 \mathrm{μs}\left({\color{gray}-3.467 \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) 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