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

Reduce the amount of data sent back to JS/TS from WASM #4874

Closed
wants to merge 1 commit into from

Conversation

jtran
Copy link
Collaborator

@jtran jtran commented Dec 29, 2024

Not ready for merging. See comments below.

Part of #4437.

We only send back the fields that are actually used. And for ProgramMemory, we clear out the memory inside closures since they're not used on the JS/TS side, as far as I know.

Copy link

qa-wolf bot commented Dec 29, 2024

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

Copy link

vercel bot commented Dec 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview Dec 29, 2024 0:36am

Copy link

codecov bot commented Dec 29, 2024

Codecov Report

Attention: Patch coverage is 8.33333% with 11 lines in your changes missing coverage. Please review.

Project coverage is 85.81%. Comparing base (70b8541) to head (c7b7b91).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/wasm-lib/kcl/src/execution/mod.rs 8.33% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4874      +/-   ##
==========================================
- Coverage   85.84%   85.81%   -0.04%     
==========================================
  Files          86       86              
  Lines       30946    30958      +12     
==========================================
+ Hits        26566    26567       +1     
- Misses       4380     4391      +11     
Flag Coverage Δ
wasm-lib 85.81% <8.33%> (-0.04%) ⬇️

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.

@jtran
Copy link
Collaborator Author

jtran commented Jan 1, 2025

Thinking about this, this branch may have broken partial execution when a pipeline uses a closure. I will need to test this when I get back.

@jtran
Copy link
Collaborator Author

jtran commented Jan 2, 2025

For this panic in #4437, I think the correct solution is to move the partial execution logic to Rust. This way, we wouldn't need to send all of program memory to TS, mutate it, and send it back to Rust. We would keep it in Rust (or filter down what we send to TS like in my draft PR), and when we do partial execution, we give the parameter(s) we need to do it on the Rust side. This way, we don't need to send program memory back and forth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant