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

Better byte[] serialization in JS interop #30288

Closed
SteveSandersonMS opened this issue Feb 19, 2021 · 4 comments
Closed

Better byte[] serialization in JS interop #30288

SteveSandersonMS opened this issue Feb 19, 2021 · 4 comments
Labels
area-blazor Includes: Blazor, Razor Components ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved
Milestone

Comments

@SteveSandersonMS
Copy link
Member

Split out from #27885

@javiercn Can you please add details about what you think we should be doing here?

@SteveSandersonMS SteveSandersonMS added the area-blazor Includes: Blazor, Razor Components label Feb 19, 2021
@SteveSandersonMS SteveSandersonMS added this to the Backlog milestone Feb 19, 2021
@ghost
Copy link

ghost commented Feb 19, 2021

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@javiercn
Copy link
Member

We currently Base64 encode binary data between .NET and JS.

This is inefficient when dealing with large enough payloads. For example, for 1GB file we send more than extra 300MB of data over the network (which are all 0's) for Blazor server. Compression is not an option here due to CRIME and BREACH security concerns.

For WebAssembly Base64 encoding and copying large amounts of memory between JavaScript and .NET Core via our JS interop is also problematic as it drastically degrades performance, which affects a wide range of multimedia applications. We want to find a better way of enabling WebAssembly to access native JS memory (ArrayBuffer, etc.) minimizing the copy and maximizing the efficiency.

We can special-case binary data within our serialization and deserialization schemes to promote efficiency across blazor server and webassembly.

@SteveSandersonMS
Copy link
Member Author

OK, thanks for clarifying. I think we already have an issue for that: #21877

Can we close this one as a dupe? Or close the other one as a dupe, assuming you agree it's the same thing.

@SteveSandersonMS SteveSandersonMS changed the title Better byte [] serialization Better byte[] serialization in JS interop Feb 19, 2021
@SteveSandersonMS
Copy link
Member Author

Since this does appear to be a duplicate of #21877, I'll close it for clarity. But if I'm wrong, please let me know and/or reopen with details.

@SteveSandersonMS SteveSandersonMS added the ✔️ Resolution: Duplicate Resolved as a duplicate of another issue label Feb 26, 2021
@ghost ghost added the Status: Resolved label Feb 26, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Mar 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved
Projects
None yet
Development

No branches or pull requests

2 participants