Moving data between JS and Rust will never be free.
And if you are doing very little work with the data, I doubt Rust will ever have a chance.
JIT compilers have gotten pretty good, and they don't have to copy any data.
Views into WebAssembly memory are only valid so long as the backing buffer isn't resized in JS. Once this function is called any future calls to Box::new (or malloc of any form) may cause the returned value here to be invalidated. Use with caution!
You would call that function and fill the returned array in JS
let array = Array::new(1024);
let buffer = array.arraybuffer();
// fill buffer
let sum = array.sum();