webassembly.memory and the game performance

35 views
Skip to first unread message

ssssss1

unread,
May 13, 2019, 9:11:19 AM5/13/19
to emscripten-discuss
Hello,

If i program 2D game in javascript and i use some modules to export and import data between C and javascript with webassembly.memory. can this slow the game because every loop the code js must enter and exit the file .wasm to pass data.

And what is the exact function that can import and export data without  slowing  the game.

Thank you.

Brian Gavin

unread,
May 14, 2019, 10:07:00 AM5/14/19
to emscripten-discuss
It is hard to say without giving more details what you are doing.   I would work on getting it to work first and if it is slow run the web browser profiler on it.   Generally speaking it is probably better to copy larger amounts of data in loop.   You may find without any optimization it is already good enough.

Brian Gavin
Reply all
Reply to author
Forward
0 new messages