hash
hash copied to clipboard
H-2758: Add package for graph SDK
🌟 What is the purpose of this PR?
We're going to use an SDK to interact with the Graph in the future. This adds a package to @local and makes sure the proper development can be started.
Pre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
- [x] 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:
- [x] are internal and do not require a docs change
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
- [x] do not affect the execution graph
Benchmark results
@rust/graph-benches – Integrations
scaling_read_entity_complete_one_depth
| Function | Value | Mean | Flame graphs |
|---|---|---|---|
| entity_by_id | 50 entities | $$274 \mathrm{ms} \pm 2.19 \mathrm{ms}\left({\color{gray}0.109 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | 10 entities | $$46.5 \mathrm{ms} \pm 2.64 \mathrm{ms}\left({\color{lightgreen}-11.547 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | 1 entities | $$21.6 \mathrm{ms} \pm 134 \mathrm{μs}\left({\color{gray}0.436 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | 25 entities | $$75.5 \mathrm{ms} \pm 350 \mathrm{μs}\left({\color{gray}0.069 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | 5 entities | $$25.8 \mathrm{ms} \pm 207 \mathrm{μs}\left({\color{gray}0.852 \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/uk-address/v/1 |
$$16.1 \mathrm{ms} \pm 172 \mathrm{μs}\left({\color{gray}-1.798 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 |
$$16.4 \mathrm{ms} \pm 182 \mathrm{μs}\left({\color{gray}-4.995 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 |
$$16.5 \mathrm{ms} \pm 150 \mathrm{μs}\left({\color{gray}-0.924 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 |
$$17.3 \mathrm{ms} \pm 219 \mathrm{μs}\left({\color{gray}1.25 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 |
$$16.6 \mathrm{ms} \pm 196 \mathrm{μs}\left({\color{gray}-1.462 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/block/v/1 |
$$18.0 \mathrm{ms} \pm 220 \mathrm{μs}\left({\color{red}10.4 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 |
$$16.4 \mathrm{ms} \pm 177 \mathrm{μs}\left({\color{gray}-4.598 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 |
$$17.3 \mathrm{ms} \pm 184 \mathrm{μs}\left({\color{lightgreen}-9.580 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 |
$$17.1 \mathrm{ms} \pm 225 \mathrm{μs}\left({\color{gray}-1.624 \mathrm{\%}}\right) $$ | Flame Graph |
representative_read_multiple_entities
| Function | Value | Mean | Flame graphs |
|---|---|---|---|
| link_by_source_by_property | depths: DT=255, PT=255, ET=255, E=255 | $$2.01 \mathrm{s} \pm 3.25 \mathrm{ms}\left({\color{gray}-0.012 \mathrm{\%}}\right) $$ | Flame Graph |
| link_by_source_by_property | depths: DT=2, PT=2, ET=2, E=2 | $$1.05 \mathrm{s} \pm 6.92 \mathrm{ms}\left({\color{gray}-0.987 \mathrm{\%}}\right) $$ | Flame Graph |
| link_by_source_by_property | depths: DT=0, PT=2, ET=2, E=2 | $$1.05 \mathrm{s} \pm 3.75 \mathrm{ms}\left({\color{gray}-1.376 \mathrm{\%}}\right) $$ | Flame Graph |
| link_by_source_by_property | depths: DT=0, PT=0, ET=0, E=2 | $$102 \mathrm{ms} \pm 625 \mathrm{μs}\left({\color{gray}3.76 \mathrm{\%}}\right) $$ | Flame Graph |
| link_by_source_by_property | depths: DT=0, PT=0, ET=2, E=2 | $$433 \mathrm{ms} \pm 4.08 \mathrm{ms}\left({\color{gray}2.76 \mathrm{\%}}\right) $$ | Flame Graph |
| link_by_source_by_property | depths: DT=0, PT=0, ET=0, E=0 | $$66.8 \mathrm{ms} \pm 568 \mathrm{μs}\left({\color{red}8.65 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_property | depths: DT=255, PT=255, ET=255, E=255 | $$2.95 \mathrm{s} \pm 19.7 \mathrm{ms}\left({\color{gray}2.68 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_property | depths: DT=2, PT=2, ET=2, E=2 | $$1.05 \mathrm{s} \pm 4.51 \mathrm{ms}\left({\color{red}6.52 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_property | depths: DT=0, PT=2, ET=2, E=2 | $$1.04 \mathrm{s} \pm 5.39 \mathrm{ms}\left({\color{gray}3.40 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_property | depths: DT=0, PT=0, ET=0, E=2 | $$43.0 \mathrm{ms} \pm 322 \mathrm{μs}\left({\color{gray}4.60 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_property | depths: DT=0, PT=0, ET=2, E=2 | $$375 \mathrm{ms} \pm 4.21 \mathrm{ms}\left({\color{gray}2.35 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_property | depths: DT=0, PT=0, ET=0, E=0 | $$38.4 \mathrm{ms} \pm 197 \mathrm{μs}\left({\color{gray}3.23 \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.44 \mathrm{ms} \pm 9.82 \mathrm{μs}\left({\color{gray}1.71 \mathrm{\%}}\right) $$ | Flame Graph |
scaling_read_entity_linkless
| Function | Value | Mean | Flame graphs |
|---|---|---|---|
| entity_by_id | 1000 entities | $$3.34 \mathrm{ms} \pm 15.7 \mathrm{μs}\left({\color{gray}-0.418 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | 100 entities | $$2.66 \mathrm{ms} \pm 13.3 \mathrm{μs}\left({\color{gray}2.03 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | 10 entities | $$2.48 \mathrm{ms} \pm 14.6 \mathrm{μs}\left({\color{gray}-0.052 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | 10000 entities | $$13.5 \mathrm{ms} \pm 134 \mathrm{μs}\left({\color{gray}1.27 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | 1 entities | $$2.50 \mathrm{ms} \pm 15.3 \mathrm{μs}\left({\color{gray}1.01 \mathrm{\%}}\right) $$ | Flame Graph |
scaling_read_entity_complete_zero_depth
| Function | Value | Mean | Flame graphs |
|---|---|---|---|
| entity_by_id | 50 entities | $$4.76 \mathrm{ms} \pm 36.5 \mathrm{μs}\left({\color{red}6.42 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | 10 entities | $$2.75 \mathrm{ms} \pm 21.9 \mathrm{μs}\left({\color{gray}3.45 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | 1 entities | $$2.50 \mathrm{ms} \pm 9.87 \mathrm{μs}\left({\color{gray}-0.440 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | 25 entities | $$3.18 \mathrm{ms} \pm 18.3 \mathrm{μs}\left({\color{gray}-0.011 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | 5 entities | $$2.54 \mathrm{ms} \pm 10.5 \mathrm{μs}\left({\color{gray}-0.055 \mathrm{\%}}\right) $$ | Flame Graph |