Avoiding creating an array object is usually faster. But it might not
matter much.

What might make a bigger difference is if you have 16 plain numeric
arguments, you can use ccall or even call it directly, with almost no
overhead, whereas with embind or ccall using an array it would have more
work to do.

- Alon



On Fri, Apr 11, 2014 at 10:47 AM, Joshua Litt <[email protected]> wrote:

> I have a c function which takes an array.  This array can have no more
> than 16 values.  Is it better from a performance standpoint to allocate an
> array in JS, and pass it to emscripten, or should I just unpack the array
> into 16 values and make a function which takes that many arguments?
>
> If it matters, most of the time the array will probably be half full.
>
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to