hashintel / hash

🚀 The open-source, multi-tenant, self-building knowledge graph
https://hash.dev
Other
1.08k stars 83 forks source link

H-3569: Create project structure for typescript harpc client #5620

Closed indietyp closed 4 days ago

indietyp commented 6 days ago

🌟 What is the purpose of this PR?

This PR creates the project structure required for harpc on the typescript side and moves the rust client from harpc/client to harpc/client/rust.

I am not a huge fan of how much this nests harpc rust client, but I wasn't able to find a better way to do. You could imagine a harpc/bindings folder, but that wouldn't really be proper as well. We can always move it if we find a better structure.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

📜 Does this require a change to the docs?

The changes in this PR:

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

The changes in this PR:

github-actions[bot] commented 5 days ago

Benchmark results

@rust/hash-graph-benches – Integrations

## scaling_read_entity_complete_one_depth | Function | Value | Mean | Flame graphs | |----------|-------|------|--------------| | entity_by_id | 25 entities | $$72.0 \mathrm{ms} \pm 464 \mathrm{μs}\left({\color{lightgreen}-16.927 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/scaling_read_entity_complete_one_depth/entity_by_id/25+entities/flamegraph.svg) | | entity_by_id | 5 entities | $$25.3 \mathrm{ms} \pm 142 \mathrm{μs}\left({\color{gray}0.206 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/scaling_read_entity_complete_one_depth/entity_by_id/5+entities/flamegraph.svg) | | entity_by_id | 1 entities | $$19.8 \mathrm{ms} \pm 87.3 \mathrm{μs}\left({\color{gray}-0.732 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/scaling_read_entity_complete_one_depth/entity_by_id/1+entities/flamegraph.svg) | | entity_by_id | 10 entities | $$46.5 \mathrm{ms} \pm 2.55 \mathrm{ms}\left({\color{red}8.74 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/scaling_read_entity_complete_one_depth/entity_by_id/10+entities/flamegraph.svg) | | entity_by_id | 50 entities | $$257 \mathrm{ms} \pm 1.67 \mathrm{ms}\left({\color{lightgreen}-52.790 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/scaling_read_entity_complete_one_depth/entity_by_id/50+entities/flamegraph.svg) | ## 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.1 \mathrm{ms} \pm 165 \mathrm{μs}\left({\color{lightgreen}-6.443 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/representative_read_entity/entity_by_id/entity+type+ID_+`https___blockprotocol.org_@alice_types_entity-t_9/flamegraph.svg) | | entity_by_id | entity type ID: `https://blockprotocol.org/@alice/types/entity-type/building/v/1` | $$16.0 \mathrm{ms} \pm 180 \mathrm{μs}\left({\color{lightgreen}-12.104 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/representative_read_entity/entity_by_id/entity+type+ID_+`https___blockprotocol.org_@alice_types_entity-t_5/flamegraph.svg) | | entity_by_id | entity type ID: `https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1` | $$17.2 \mathrm{ms} \pm 235 \mathrm{μs}\left({\color{gray}4.03 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/representative_read_entity/entity_by_id/entity+type+ID_+`https___blockprotocol.org_@alice_types_entity-t_6/flamegraph.svg) | | entity_by_id | entity type ID: `https://blockprotocol.org/@alice/types/entity-type/page/v/2` | $$17.1 \mathrm{ms} \pm 255 \mathrm{μs}\left({\color{gray}-0.772 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/representative_read_entity/entity_by_id/entity+type+ID_+`https___blockprotocol.org_@alice_types_entity-t_3/flamegraph.svg) | | entity_by_id | entity type ID: `https://blockprotocol.org/@alice/types/entity-type/playlist/v/1` | $$17.1 \mathrm{ms} \pm 218 \mathrm{μs}\left({\color{gray}0.936 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/representative_read_entity/entity_by_id/entity+type+ID_+`https___blockprotocol.org_@alice_types_entity-t_7/flamegraph.svg) | | entity_by_id | entity type ID: `https://blockprotocol.org/@alice/types/entity-type/song/v/1` | $$17.3 \mathrm{ms} \pm 215 \mathrm{μs}\left({\color{gray}1.47 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/representative_read_entity/entity_by_id/entity+type+ID_+`https___blockprotocol.org_@alice_types_entity-t_8/flamegraph.svg) | | entity_by_id | entity type ID: `https://blockprotocol.org/@alice/types/entity-type/person/v/1` | $$17.2 \mathrm{ms} \pm 219 \mathrm{μs}\left({\color{gray}1.23 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/representative_read_entity/entity_by_id/entity+type+ID_+`https___blockprotocol.org_@alice_types_entity-t_4/flamegraph.svg) | | entity_by_id | entity type ID: `https://blockprotocol.org/@alice/types/entity-type/block/v/1` | $$17.2 \mathrm{ms} \pm 242 \mathrm{μs}\left({\color{gray}1.45 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/representative_read_entity/entity_by_id/entity+type+ID_+`https___blockprotocol.org_@alice_types_entity-t/flamegraph.svg) | | entity_by_id | entity type ID: `https://blockprotocol.org/@alice/types/entity-type/book/v/1` | $$16.6 \mathrm{ms} \pm 217 \mathrm{μs}\left({\color{gray}-0.023 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/representative_read_entity/entity_by_id/entity+type+ID_+`https___blockprotocol.org_@alice_types_entity-t_2/flamegraph.svg) | ## scaling_read_entity_complete_zero_depth | Function | Value | Mean | Flame graphs | |----------|-------|------|--------------| | entity_by_id | 25 entities | $$2.74 \mathrm{ms} \pm 13.4 \mathrm{μs}\left({\color{lightgreen}-17.007 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/scaling_read_entity_complete_zero_depth/entity_by_id/25+entities/flamegraph.svg) | | entity_by_id | 5 entities | $$1.90 \mathrm{ms} \pm 11.3 \mathrm{μs}\left({\color{gray}-1.185 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/scaling_read_entity_complete_zero_depth/entity_by_id/5+entities/flamegraph.svg) | | entity_by_id | 1 entities | $$1.87 \mathrm{ms} \pm 8.68 \mathrm{μs}\left({\color{gray}-0.103 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/scaling_read_entity_complete_zero_depth/entity_by_id/1+entities/flamegraph.svg) | | entity_by_id | 10 entities | $$2.08 \mathrm{ms} \pm 15.0 \mathrm{μs}\left({\color{gray}-1.436 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/scaling_read_entity_complete_zero_depth/entity_by_id/10+entities/flamegraph.svg) | | entity_by_id | 50 entities | $$4.34 \mathrm{ms} \pm 44.3 \mathrm{μs}\left({\color{gray}0.770 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/scaling_read_entity_complete_zero_depth/entity_by_id/50+entities/flamegraph.svg) | ## scaling_read_entity_linkless | Function | Value | Mean | Flame graphs | |----------|-------|------|--------------| | entity_by_id | 1 entities | $$1.87 \mathrm{ms} \pm 7.46 \mathrm{μs}\left({\color{gray}0.260 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/scaling_read_entity_linkless/entity_by_id/1+entities/flamegraph.svg) | | entity_by_id | 10000 entities | $$13.7 \mathrm{ms} \pm 75.7 \mathrm{μs}\left({\color{gray}0.175 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/scaling_read_entity_linkless/entity_by_id/10000+entities/flamegraph.svg) | | entity_by_id | 100 entities | $$2.04 \mathrm{ms} \pm 9.25 \mathrm{μs}\left({\color{gray}0.973 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/scaling_read_entity_linkless/entity_by_id/100+entities/flamegraph.svg) | | entity_by_id | 1000 entities | $$2.82 \mathrm{ms} \pm 15.6 \mathrm{μs}\left({\color{gray}0.213 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/scaling_read_entity_linkless/entity_by_id/1000+entities/flamegraph.svg) | | entity_by_id | 10 entities | $$1.91 \mathrm{ms} \pm 8.29 \mathrm{μs}\left({\color{gray}0.926 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/scaling_read_entity_linkless/entity_by_id/10+entities/flamegraph.svg) | ## representative_read_multiple_entities | Function | Value | Mean | Flame graphs | |----------|-------|------|--------------| | link_by_source_by_property | depths: DT=255, PT=255, ET=255, E=255 | $$107 \mathrm{ms} \pm 370 \mathrm{μs}\left({\color{gray}-0.987 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/representative_read_multiple_entities/link_by_source_by_property/depths_+DT=255,+PT=255,+ET=255,+E=255/flamegraph.svg) | | link_by_source_by_property | depths: DT=0, PT=0, ET=2, E=2 | $$88.7 \mathrm{ms} \pm 366 \mathrm{μs}\left({\color{gray}-1.031 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/representative_read_multiple_entities/link_by_source_by_property/depths_+DT=0,+PT=0,+ET=2,+E=2/flamegraph.svg) | | link_by_source_by_property | depths: DT=2, PT=2, ET=2, E=2 | $$98.2 \mathrm{ms} \pm 588 \mathrm{μs}\left({\color{gray}-0.274 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/representative_read_multiple_entities/link_by_source_by_property/depths_+DT=2,+PT=2,+ET=2,+E=2/flamegraph.svg) | | link_by_source_by_property | depths: DT=0, PT=0, ET=0, E=0 | $$42.9 \mathrm{ms} \pm 298 \mathrm{μs}\left({\color{gray}0.296 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/representative_read_multiple_entities/link_by_source_by_property/depths_+DT=0,+PT=0,+ET=0,+E=0/flamegraph.svg) | | link_by_source_by_property | depths: DT=0, PT=2, ET=2, E=2 | $$93.7 \mathrm{ms} \pm 646 \mathrm{μs}\left({\color{gray}-0.639 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/representative_read_multiple_entities/link_by_source_by_property/depths_+DT=0,+PT=2,+ET=2,+E=2/flamegraph.svg) | | link_by_source_by_property | depths: DT=0, PT=0, ET=0, E=2 | $$80.4 \mathrm{ms} \pm 423 \mathrm{μs}\left({\color{gray}-0.468 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/representative_read_multiple_entities/link_by_source_by_property/depths_+DT=0,+PT=0,+ET=0,+E=2/flamegraph.svg) | | entity_by_property | depths: DT=255, PT=255, ET=255, E=255 | $$68.6 \mathrm{ms} \pm 362 \mathrm{μs}\left({\color{gray}-0.429 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/representative_read_multiple_entities/entity_by_property/depths_+DT=255,+PT=255,+ET=255,+E=255/flamegraph.svg) | | entity_by_property | depths: DT=0, PT=0, ET=2, E=2 | $$49.8 \mathrm{ms} \pm 335 \mathrm{μs}\left({\color{gray}-0.260 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/representative_read_multiple_entities/entity_by_property/depths_+DT=0,+PT=0,+ET=2,+E=2/flamegraph.svg) | | entity_by_property | depths: DT=2, PT=2, ET=2, E=2 | $$59.4 \mathrm{ms} \pm 471 \mathrm{μs}\left({\color{gray}-0.068 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/representative_read_multiple_entities/entity_by_property/depths_+DT=2,+PT=2,+ET=2,+E=2/flamegraph.svg) | | entity_by_property | depths: DT=0, PT=0, ET=0, E=0 | $$40.0 \mathrm{ms} \pm 190 \mathrm{μs}\left({\color{gray}-0.400 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/representative_read_multiple_entities/entity_by_property/depths_+DT=0,+PT=0,+ET=0,+E=0/flamegraph.svg) | | entity_by_property | depths: DT=0, PT=2, ET=2, E=2 | $$54.5 \mathrm{ms} \pm 354 \mathrm{μs}\left({\color{gray}0.143 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/representative_read_multiple_entities/entity_by_property/depths_+DT=0,+PT=2,+ET=2,+E=2/flamegraph.svg) | | entity_by_property | depths: DT=0, PT=0, ET=0, E=2 | $$44.0 \mathrm{ms} \pm 227 \mathrm{μs}\left({\color{gray}-0.370 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/representative_read_multiple_entities/entity_by_property/depths_+DT=0,+PT=0,+ET=0,+E=2/flamegraph.svg) | ## representative_read_entity_type | Function | Value | Mean | Flame graphs | |----------|-------|------|--------------| | get_entity_type_by_id | Account ID: `d4e16033-c281-4cde-aa35-9085bf2e7579` | $$1.38 \mathrm{ms} \pm 6.54 \mathrm{μs}\left({\color{gray}0.111 \mathrm{\\%}}\right) $$ | [Flame Graph](https://benchmarks.hash.dev/de0f9803e49e75af301826ea974a72d86f241a19/representative_read_entity_type/get_entity_type_by_id/Account+ID_+`d4e16033-c281-4cde-aa35-9085bf2e7579`/flamegraph.svg) |