hash
hash copied to clipboard
H-3428: Implement folding for string constraints
🌟 What is the purpose of this PR?
Similar to previous PRs, this adds folding for string constraints
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
🛡 What tests cover this?
- Various tests were added
Benchmark results
@rust/graph-benches – Integrations
representative_read_entity_type
| Function | Value | Mean | Flame graphs |
|---|---|---|---|
| get_entity_type_by_id | Account ID: d4e16033-c281-4cde-aa35-9085bf2e7579 |
$$1.43 \mathrm{ms} \pm 4.80 \mathrm{μs}\left({\color{gray}1.04 \mathrm{\%}}\right) $$ | Flame Graph |
scaling_read_entity_complete_zero_depth
| Function | Value | Mean | Flame graphs |
|---|---|---|---|
| entity_by_id | 10 entities | $$2.07 \mathrm{ms} \pm 13.6 \mathrm{μs}\left({\color{gray}0.474 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | 50 entities | $$4.05 \mathrm{ms} \pm 29.2 \mathrm{μs}\left({\color{gray}-0.923 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | 1 entities | $$1.86 \mathrm{ms} \pm 6.88 \mathrm{μs}\left({\color{gray}-0.201 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | 5 entities | $$1.90 \mathrm{ms} \pm 9.77 \mathrm{μs}\left({\color{gray}0.222 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | 25 entities | $$2.77 \mathrm{ms} \pm 81.4 \mathrm{μs}\left({\color{lightgreen}-9.535 \mathrm{\%}}\right) $$ | Flame Graph |
scaling_read_entity_linkless
| Function | Value | Mean | Flame graphs |
|---|---|---|---|
| entity_by_id | 10 entities | $$1.88 \mathrm{ms} \pm 13.8 \mathrm{μs}\left({\color{gray}-0.589 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | 1000 entities | $$2.74 \mathrm{ms} \pm 15.6 \mathrm{μs}\left({\color{lightgreen}-6.867 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | 1 entities | $$1.88 \mathrm{ms} \pm 8.65 \mathrm{μs}\left({\color{gray}0.441 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | 10000 entities | $$12.6 \mathrm{ms} \pm 139 \mathrm{μs}\left({\color{red}42.8 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | 100 entities | $$2.03 \mathrm{ms} \pm 12.5 \mathrm{μs}\left({\color{gray}1.22 \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 | $$68.6 \mathrm{ms} \pm 290 \mathrm{μs}\left({\color{gray}-1.754 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_property | depths: DT=0, PT=2, ET=2, E=2 | $$54.6 \mathrm{ms} \pm 312 \mathrm{μs}\left({\color{gray}-2.676 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_property | depths: DT=0, PT=0, ET=0, E=0 | $$38.9 \mathrm{ms} \pm 160 \mathrm{μs}\left({\color{gray}-1.545 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_property | depths: DT=0, PT=0, ET=2, E=2 | $$50.8 \mathrm{ms} \pm 312 \mathrm{μs}\left({\color{gray}-2.176 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_property | depths: DT=0, PT=0, ET=0, E=2 | $$44.0 \mathrm{ms} \pm 272 \mathrm{μs}\left({\color{gray}-2.084 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_property | depths: DT=2, PT=2, ET=2, E=2 | $$59.1 \mathrm{ms} \pm 349 \mathrm{μs}\left({\color{gray}-3.739 \mathrm{\%}}\right) $$ | Flame Graph |
| link_by_source_by_property | depths: DT=255, PT=255, ET=255, E=255 | $$107 \mathrm{ms} \pm 371 \mathrm{μs}\left({\color{lightgreen}-5.002 \mathrm{\%}}\right) $$ | Flame Graph |
| link_by_source_by_property | depths: DT=0, PT=2, ET=2, E=2 | $$93.5 \mathrm{ms} \pm 312 \mathrm{μs}\left({\color{gray}-2.664 \mathrm{\%}}\right) $$ | Flame Graph |
| link_by_source_by_property | depths: DT=0, PT=0, ET=0, E=0 | $$41.8 \mathrm{ms} \pm 245 \mathrm{μs}\left({\color{lightgreen}-5.161 \mathrm{\%}}\right) $$ | Flame Graph |
| link_by_source_by_property | depths: DT=0, PT=0, ET=2, E=2 | $$89.8 \mathrm{ms} \pm 562 \mathrm{μs}\left({\color{gray}-1.379 \mathrm{\%}}\right) $$ | Flame Graph |
| link_by_source_by_property | depths: DT=0, PT=0, ET=0, E=2 | $$78.9 \mathrm{ms} \pm 392 \mathrm{μs}\left({\color{gray}-3.313 \mathrm{\%}}\right) $$ | Flame Graph |
| link_by_source_by_property | depths: DT=2, PT=2, ET=2, E=2 | $$98.8 \mathrm{ms} \pm 410 \mathrm{μs}\left({\color{gray}-2.942 \mathrm{\%}}\right) $$ | Flame Graph |
scaling_read_entity_complete_one_depth
| Function | Value | Mean | Flame graphs |
|---|---|---|---|
| entity_by_id | 10 entities | $$44.1 \mathrm{ms} \pm 3.30 \mathrm{ms}\left({\color{lightgreen}-10.456 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | 50 entities | $$398 \mathrm{ms} \pm 119 \mathrm{ms}\left({\color{red}45.9 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | 1 entities | $$19.9 \mathrm{ms} \pm 99.4 \mathrm{μs}\left({\color{gray}-0.994 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | 5 entities | $$25.0 \mathrm{ms} \pm 235 \mathrm{μs}\left({\color{gray}0.039 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | 25 entities | $$71.8 \mathrm{ms} \pm 355 \mathrm{μs}\left({\color{gray}-0.246 \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/playlist/v/1 |
$$15.9 \mathrm{ms} \pm 151 \mathrm{μs}\left({\color{gray}-2.645 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 |
$$15.2 \mathrm{ms} \pm 192 \mathrm{μs}\left({\color{lightgreen}-6.514 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 |
$$16.5 \mathrm{ms} \pm 163 \mathrm{μs}\left({\color{gray}2.75 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 |
$$15.7 \mathrm{ms} \pm 166 \mathrm{μs}\left({\color{gray}-4.953 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 |
$$15.6 \mathrm{ms} \pm 182 \mathrm{μs}\left({\color{lightgreen}-27.661 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/block/v/1 |
$$16.1 \mathrm{ms} \pm 167 \mathrm{μs}\left({\color{gray}2.25 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 |
$$16.0 \mathrm{ms} \pm 179 \mathrm{μs}\left({\color{red}20.0 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 |
$$15.8 \mathrm{ms} \pm 129 \mathrm{μs}\left({\color{lightgreen}-35.184 \mathrm{\%}}\right) $$ | Flame Graph |
| entity_by_id | entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 |
$$16.0 \mathrm{ms} \pm 204 \mathrm{μs}\left({\color{gray}3.43 \mathrm{\%}}\right) $$ | Flame Graph |