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-3976: Replace Buffer in favour of MutableBuffer #6277

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

Conversation

indietyp
Copy link
Member

🌟 What is the purpose of this PR?

Right now the Buffer is immutable in the sense that we make use of SubscriptionRef for atomic effects, should a buffer be used across forks/fibers. This has quite the overhead, especially for something so central, instead the Effect code should be replaced with Either code.

Profiling has shown that this is a 400-600% speedup, primarily because we no longer synchronize the index and have therefore a lot lower of an overhead.

in Rust terms this basically moved this from async to sync code.

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:

  • are internal and do not require a docs change

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

The changes in this PR:

  • do not affect the execution graph

@indietyp indietyp self-assigned this Jan 28, 2025
@github-actions github-actions bot added area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team area/tests New or updated tests labels Jan 28, 2025
Copy link

codecov bot commented Jan 28, 2025

Codecov Report

Attention: Patch coverage is 79.05138% with 53 lines in your changes missing coverage. Please review.

Project coverage is 21.39%. Comparing base (72a325f) to head (a38a6d9).
Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
...arpc/client/typescript/src/binary/MutableBuffer.ts 92.85% 4 Missing and 3 partials ⚠️
...pt/src/wire-protocol/models/request/RequestBody.ts 45.45% 6 Missing ⚠️
...ript/src/wire-protocol/models/response/Response.ts 33.33% 6 Missing ⚠️
...local/harpc/client/typescript/src/types/Version.ts 62.50% 3 Missing ⚠️
...ent/typescript/src/wire-protocol/models/Payload.ts 80.00% 2 Missing and 1 partial ⚠️
.../src/wire-protocol/models/response/ResponseBody.ts 72.72% 3 Missing ⚠️
...ocal/harpc/client/typescript/src/net/Connection.ts 0.00% 2 Missing ⚠️
...t/src/wire-protocol/models/request/RequestBegin.ts 60.00% 2 Missing ⚠️
...t/src/wire-protocol/models/request/RequestFlags.ts 60.00% 2 Missing ⚠️
...t/src/wire-protocol/models/request/RequestFrame.ts 60.00% 2 Missing ⚠️
... and 16 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6277      +/-   ##
==========================================
+ Coverage   21.21%   21.39%   +0.17%     
==========================================
  Files         573      573              
  Lines       19658    19682      +24     
  Branches     2870     2884      +14     
==========================================
+ Hits         4171     4210      +39     
+ Misses      15435    15415      -20     
- Partials       52       57       +5     
Flag Coverage Δ
apps.hash-ai-worker-ts 1.39% <ø> (ø)
apps.hash-api 1.14% <ø> (ø)
local.harpc-client 50.49% <79.05%> (+1.79%) ⬆️
local.hash-backend-utils 8.81% <ø> (ø)
local.hash-graph-sdk 58.62% <ø> (ø)
local.hash-isomorphic-utils 0.91% <ø> (ø)
local.hash-subgraph 24.54% <ø> (ø)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/libs Relates to first-party libraries/crates/packages (area) area/tests New or updated tests type/eng > backend Owned by the @backend team
Development

Successfully merging this pull request may close these issues.

1 participant