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-3762, H-3763, H-3757: Experiment with biome #6031

Open
wants to merge 33 commits into
base: main
Choose a base branch
from

Conversation

indietyp
Copy link
Member

@indietyp indietyp commented Dec 30, 2024

🌟 What is the purpose of this PR?

Biome is a suite of TypeScript tools that are written in Rust (originally known as Rome), it allows us to lint, format, and analyse a whole suite of problems.

The hope is that biome enables developers to have a faster workflow with minimal intrusions.

Some stats: fix:prettier previously took 20 seconds(!), fix:biome now takes 293ms, that's a 70x speed increase.

We also no longer need a .prettierignore file, meaning we're just down to .dockerignore and .gitignore.

🔗 Related links

🔍 What does this change?

  • initialize biome
  • replace prettier with biome
  • replace prettier package.json plugin with sort-package-json package
  • adjust lefthook (drive-by)
  • adjust CI

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • 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:

  • require changes to docs which are made as part of this PR

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

The changes in this PR:

  • do not affect the execution graph

@github-actions github-actions bot added area/deps Relates to third-party dependencies (area) area/apps > hash* Affects HASH (a `hash-*` app) area/infra Relates to version control, CI, CD or IaC (area) area/apps > hash-api Affects the HASH API (app) area/blocks Relates to first-party blocks (area) area/libs Relates to first-party libraries/crates/packages (area) area/dx Improvements or additions to DX or docs type/eng > frontend Owned by the @frontend team type/eng > backend Owned by the @backend team area/apps labels Dec 30, 2024
Copy link

codecov bot commented Dec 30, 2024

Codecov Report

Attention: Patch coverage is 0% with 120 lines in your changes missing coverage. Please review.

Project coverage is 21.69%. Comparing base (55f9064) to head (6ef88fc).

Files with missing lines Patch % Lines
apps/hash-api/src/integrations/linear/oauth.ts 0.00% 68 Missing ⚠️
...hash-api/src/integrations/google/oauth-callback.ts 0.00% 36 Missing ⚠️
...-api/src/integrations/google/check-access-token.ts 0.00% 4 Missing ⚠️
...sh-api/src/integrations/google/get-access-token.ts 0.00% 4 Missing ⚠️
...h-isomorphic-utils/src/flows/action-definitions.ts 0.00% 4 Missing ⚠️
...l/hash-isomorphic-utils/src/simplify-properties.ts 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6031      +/-   ##
==========================================
- Coverage   21.72%   21.69%   -0.04%     
==========================================
  Files         566      566              
  Lines       19156    19156              
  Branches     2755     2755              
==========================================
- Hits         4162     4156       -6     
- Misses      14942    14949       +7     
+ Partials       52       51       -1     
Flag Coverage Δ
apps.hash-ai-worker-ts 1.32% <ø> (ø)
apps.hash-api 1.16% <0.00%> (ø)
blockprotocol.type-system 46.42% <ø> (ø)
local.harpc-client 50.17% <ø> (ø)
local.hash-backend-utils 8.81% <ø> (ø)
local.hash-graph-sdk 58.62% <ø> (ø)
local.hash-isomorphic-utils 0.98% <0.00%> (ø)
local.hash-subgraph 24.54% <ø> (ø)
rust.deer 6.66% <ø> (ø)
rust.error-stack 72.51% <ø> (ø)
rust.sarif 88.66% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@indietyp
Copy link
Member Author

indietyp commented Dec 30, 2024

CI is failing because yarn install modifies the package.json files and formats them, even though they're formatted by prettier.

see: yarnpkg/berry#2636 (reply in thread)

@indietyp indietyp marked this pull request as ready for review December 30, 2024 22:50
Copy link
Contributor

Benchmark results

@rust/hash-graph-benches – Integrations

representative_read_entity

Function Value Mean Flame graphs
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$16.3 \mathrm{ms} \pm 175 \mathrm{μs}\left({\color{lightgreen}-28.247 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$15.8 \mathrm{ms} \pm 149 \mathrm{μs}\left({\color{gray}-3.174 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$15.7 \mathrm{ms} \pm 154 \mathrm{μs}\left({\color{gray}-4.033 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$16.9 \mathrm{ms} \pm 163 \mathrm{μs}\left({\color{gray}4.37 \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 154 \mathrm{μs}\left({\color{gray}2.58 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$15.4 \mathrm{ms} \pm 184 \mathrm{μs}\left({\color{lightgreen}-6.268 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$16.3 \mathrm{ms} \pm 164 \mathrm{μs}\left({\color{gray}2.01 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$16.4 \mathrm{ms} \pm 163 \mathrm{μs}\left({\color{lightgreen}-27.791 \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 176 \mathrm{μs}\left({\color{lightgreen}-15.349 \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 $$66.1 \mathrm{ms} \pm 401 \mathrm{μs}\left({\color{gray}-0.246 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=0, E=0 $$38.7 \mathrm{ms} \pm 234 \mathrm{μs}\left({\color{gray}-1.478 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=2, PT=2, ET=2, E=2 $$56.6 \mathrm{ms} \pm 269 \mathrm{μs}\left({\color{gray}-0.832 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=0, E=2 $$43.0 \mathrm{ms} \pm 286 \mathrm{μs}\left({\color{gray}-1.276 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=2, E=2 $$48.7 \mathrm{ms} \pm 338 \mathrm{μs}\left({\color{gray}-0.535 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=2, ET=2, E=2 $$53.2 \mathrm{ms} \pm 307 \mathrm{μs}\left({\color{gray}-0.389 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=255, PT=255, ET=255, E=255 $$102 \mathrm{ms} \pm 567 \mathrm{μs}\left({\color{gray}0.280 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=0, E=0 $$38.8 \mathrm{ms} \pm 274 \mathrm{μs}\left({\color{gray}-0.007 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=2, PT=2, ET=2, E=2 $$93.1 \mathrm{ms} \pm 484 \mathrm{μs}\left({\color{gray}0.319 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=0, E=2 $$76.4 \mathrm{ms} \pm 301 \mathrm{μs}\left({\color{gray}-0.041 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=2, E=2 $$85.0 \mathrm{ms} \pm 511 \mathrm{μs}\left({\color{gray}-0.345 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=2, ET=2, E=2 $$89.2 \mathrm{ms} \pm 518 \mathrm{μs}\left({\color{gray}-0.285 \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.11 \mathrm{ms} \pm 5.96 \mathrm{μs}\left({\color{gray}0.416 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_complete_one_depth

Function Value Mean Flame graphs
entity_by_id 50 entities $$5.62 \mathrm{s} \pm 280 \mathrm{ms}\left({\color{red}5.56 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 5 entities $$27.1 \mathrm{ms} \pm 342 \mathrm{μs}\left({\color{gray}1.92 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$20.4 \mathrm{ms} \pm 69.8 \mathrm{μs}\left({\color{gray}-0.730 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$31.2 \mathrm{ms} \pm 156 \mathrm{μs}\left({\color{gray}-0.941 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 25 entities $$173 \mathrm{ms} \pm 627 \mathrm{μs}\left({\color{gray}-2.378 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$1.91 \mathrm{ms} \pm 5.90 \mathrm{μs}\left({\color{gray}-0.896 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$2.14 \mathrm{ms} \pm 8.41 \mathrm{μs}\left({\color{gray}2.19 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$1.94 \mathrm{ms} \pm 5.28 \mathrm{μs}\left({\color{gray}-0.028 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$2.93 \mathrm{ms} \pm 16.0 \mathrm{μs}\left({\color{gray}3.85 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$13.3 \mathrm{ms} \pm 42.7 \mathrm{μs}\left({\color{gray}-0.478 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_complete_zero_depth

Function Value Mean Flame graphs
entity_by_id 50 entities $$4.12 \mathrm{ms} \pm 19.5 \mathrm{μs}\left({\color{gray}3.69 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 5 entities $$1.93 \mathrm{ms} \pm 5.85 \mathrm{μs}\left({\color{gray}-0.620 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$1.92 \mathrm{ms} \pm 4.77 \mathrm{μs}\left({\color{gray}-0.188 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$2.11 \mathrm{ms} \pm 11.9 \mathrm{μs}\left({\color{gray}1.07 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 25 entities $$3.22 \mathrm{ms} \pm 8.11 \mathrm{μs}\left({\color{gray}-1.022 \mathrm{\%}}\right) $$ Flame Graph

@vilkinsons vilkinsons requested a review from CiaranMn December 31, 2024 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/apps > hash.dev Affects the `hash.dev` developer site (app) area/apps > hash* Affects HASH (a `hash-*` app) area/apps > hash-api Affects the HASH API (app) area/apps area/blocks Relates to first-party blocks (area) area/deps Relates to third-party dependencies (area) area/dx Improvements or additions to DX or docs area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team type/eng > frontend Owned by the @frontend team
Development

Successfully merging this pull request may close these issues.

2 participants