Replies: 2 comments
-
cc @pavelsavara |
Beta Was this translation helpful? Give feedback.
-
How does it break ? Do we have a bug ?
This would not work because other JS objects are not directly visible in WASM linear memory, where the dotnet lives I wonder if your json is really a JS String. Maybe if you had UTF8 data, you could allocate native buffer and use views to copy the data into WASM memory. See localHeapViewU8 The idea of parsing the JSON via streaming parser in C# makes lot of sense. Also providing the data in smaller chunks is good. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Rebuilding an (Electron) application incrementally in .NET using the strangler pattern, I have the need to load a very large serialized object (JSON, >35MB) into .NET. I've noticed that it kinda-breaks when I load such a large string in .NET at once (
JSExport
).For this reason I've now chunked this string into 1MB strings, at the .NET side I collect this via a
StreamWriter
, and finally deserialize it usingJsonSerializer
.I wonder if there are better approaches, like serializing it to an
[Shared]ArrayBuffer
and either pass that directly to .NET or construct anTypedArray
likeUInt8Array
and pass that to .NET? Any suggestions?Beta Was this translation helpful? Give feedback.
All reactions