Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

356
Vistas
Access Blazor object[] from Javascript without passing data through unmarshalled call

Just want to highlight that I have been at this for about a week and am new to dealing with the heap and pointers and have not had to interact directly with it before. Could really use some help as I have not made any progress.

Problem statement: Need to access an object[] that I created on Blazor side from Javascript without the use of JSUnmarshalled call from Blazor to pass the data in.

Why? Using the JSUnmarshalled call is still too slow for how large the object[] is even though it only takes .25ms (yes .25ms) to actually create the entire array. The array takes 2 seconds to pass to JS. This is a problem because I am rapidly making adjustments based on user input and most time is spent on waiting for the data to be passed over which causes poor user experience.

What I am currently doing:

c# side

JSUnmarshalledRuntime.InvokeUnmarshalled<object[], object>("InitializeGeometry", RenderModel.GetCombined());

InitializeGeometry calls this JS function to process the object[]

JS side

function getInt32Heap(data) {
var m = data + 12;
var r = Module.HEAP32[m >> 2]
return Array.from(new Int32Array(Module.HEAP32.buffer, m + 4, r));}

This is working fine but is quite slow. What I have tried to find is a way to create a pointer for the object[] on the Blazor side and then pass it into JS. Then on the JS side figure out how to use that pointer to get the same data out that I am currently getting.

I have reached out to the .Net team and this is my original question. https://github.com/dotnet/aspnetcore/issues/41490

Here is what I have looked through https://github.com/dotnet/aspnetcore/blob/main/src/Components/Web.JS/src/Rendering/RenderBatch/SharedMemoryRenderBatch.ts

Also found this https://github.com/SteveSandersonMS/BlazorInputFile/blob/db10236b049ea05de28de9b7806447a3c84c8465/BlazorInputFile/wwwroot/inputfile.js#L113

And this https://blog.elmah.io/using-js-object-references-in-blazor-wasm-to-wrap-js-libraries/?msclkid=9826568bcf8d11ecbdab91d116441786

Again, I am new to this so the answers may be in here but I am not seeing them. I know this is due to my lack of understanding but so far I have not read anything that puts things into perspective for me. Any help would be greatly appreciated!

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda