I am working on using WebAssembly in Netlify functions.
The problem is that it takes about 24s for WebAssembly.instantiate to finish, exceeding the 10s limit of timeout.
I confirmed the duration (24s) by using it as a background function. I wrote console.logs before WebAssembly.instantiate and in the then-clause of it to measure time. However, I want the function to be a non-background one since I want to return the result of the function to the client side.
The size of the .wasm file is about 9MB. It is a sheet music library called webmscore (GitHub - LibreScore/webmscore: MuseScore's core library (libmscore) in WebAssembly! Read mscz data, and generate audio/MIDI/MusicXML/SVG/PNG/PDF sheets right in browsers.).
In the local environment (Netlify dev in Windows 10), it takes about 5s. In the client side (Chrome browser), it takes less than 1s. Is it normal for the instantiation to take such a long time in Netlify functions? Is there any way to make it faster?
site name: https://sage-valkyrie-8fdb30.netlify.app
Thank you!