hash icon indicating copy to clipboard operation
hash copied to clipboard

H-3241: HQL: Introduce J-Expr frontend

Open indietyp opened this issue 1 year ago • 2 comments

🌟 What is the purpose of this PR?

This PR introduces text-based parsing for the J-Expr language.

The parsing utilizes Logo for tokenization, and then hifijson for parsing of strings and numbers.

The parsing has been fuzz tested, to ensure that JSON parsing is correct.

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] affected the execution graph, and the turbo.json's have been updated to reflect this

📹 Demo

Look at the snapshots for some beautiful diagnostics.

indietyp avatar Aug 09 '24 09:08 indietyp

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Benchmark results

@rust/graph-benches – Integrations

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property depths: DT=0, PT=2, ET=2, E=2 $$52.3 \mathrm{ms} \pm 227 \mathrm{μs}\left({\color{gray}-2.279 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=2, PT=2, ET=2, E=2 $$56.9 \mathrm{ms} \pm 344 \mathrm{μs}\left({\color{gray}-1.304 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=0, E=2 $$42.0 \mathrm{ms} \pm 212 \mathrm{μs}\left({\color{gray}-1.404 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=2, E=2 $$48.4 \mathrm{ms} \pm 242 \mathrm{μs}\left({\color{gray}-2.317 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=255, PT=255, ET=255, E=255 $$65.3 \mathrm{ms} \pm 254 \mathrm{μs}\left({\color{gray}-0.720 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=0, E=0 $$37.9 \mathrm{ms} \pm 158 \mathrm{μs}\left({\color{gray}-2.503 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=2, ET=2, E=2 $$93.3 \mathrm{ms} \pm 329 \mathrm{μs}\left({\color{gray}-1.571 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=2, PT=2, ET=2, E=2 $$97.5 \mathrm{ms} \pm 518 \mathrm{μs}\left({\color{gray}-2.099 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=0, E=2 $$79.1 \mathrm{ms} \pm 394 \mathrm{μs}\left({\color{gray}-1.598 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=2, E=2 $$88.9 \mathrm{ms} \pm 392 \mathrm{μs}\left({\color{gray}-1.844 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=255, PT=255, ET=255, E=255 $$105 \mathrm{ms} \pm 506 \mathrm{μs}\left({\color{gray}-2.112 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=0, E=0 $$40.4 \mathrm{ms} \pm 230 \mathrm{μs}\left({\color{gray}-2.968 \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 $$17.1 \mathrm{ms} \pm 271 \mathrm{μs}\left({\color{gray}-0.227 \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 203 \mathrm{μs}\left({\color{lightgreen}-6.576 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$17.4 \mathrm{ms} \pm 242 \mathrm{μs}\left({\color{red}7.64 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$17.2 \mathrm{ms} \pm 237 \mathrm{μs}\left({\color{gray}1.51 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$17.2 \mathrm{ms} \pm 255 \mathrm{μs}\left({\color{gray}2.55 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$18.4 \mathrm{ms} \pm 265 \mathrm{μs}\left({\color{red}12.9 \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 226 \mathrm{μs}\left({\color{gray}0.534 \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 215 \mathrm{μs}\left({\color{lightgreen}-6.857 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$16.8 \mathrm{ms} \pm 232 \mathrm{μs}\left({\color{gray}0.293 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_complete_one_depth

Function Value Mean Flame graphs
entity_by_id 10 entities $$31.2 \mathrm{ms} \pm 127 \mathrm{μs}\left({\color{lightgreen}-32.008 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 25 entities $$71.6 \mathrm{ms} \pm 370 \mathrm{μs}\left({\color{gray}-1.465 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 50 entities $$1.54 \mathrm{s} \pm 4.05 \mathrm{ms}\left({\color{gray}-0.448 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 5 entities $$25.3 \mathrm{ms} \pm 357 \mathrm{μs}\left({\color{gray}1.96 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$20.0 \mathrm{ms} \pm 189 \mathrm{μs}\left({\color{gray}0.001 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_complete_zero_depth

Function Value Mean Flame graphs
entity_by_id 10 entities $$2.08 \mathrm{ms} \pm 14.4 \mathrm{μs}\left({\color{gray}0.282 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 25 entities $$2.75 \mathrm{ms} \pm 78.6 \mathrm{μs}\left({\color{red}5.46 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 50 entities $$3.93 \mathrm{ms} \pm 24.1 \mathrm{μs}\left({\color{gray}-3.230 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 5 entities $$1.92 \mathrm{ms} \pm 9.24 \mathrm{μs}\left({\color{gray}-0.553 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$1.85 \mathrm{ms} \pm 8.00 \mathrm{μs}\left({\color{gray}-1.675 \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.41 \mathrm{ms} \pm 9.23 \mathrm{μs}\left({\color{gray}0.180 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_linkless

Function Value Mean Flame graphs
entity_by_id 10 entities $$1.87 \mathrm{ms} \pm 7.80 \mathrm{μs}\left({\color{gray}0.403 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$2.01 \mathrm{ms} \pm 8.71 \mathrm{μs}\left({\color{gray}0.301 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$3.61 \mathrm{ms} \pm 13.6 \mathrm{μs}\left({\color{red}29.9 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$13.5 \mathrm{ms} \pm 150 \mathrm{μs}\left({\color{gray}1.82 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$1.85 \mathrm{ms} \pm 11.3 \mathrm{μs}\left({\color{gray}-1.817 \mathrm{\%}}\right) $$ Flame Graph

github-actions[bot] avatar Aug 30 '24 16:08 github-actions[bot]