Re: Optimization takes a long time!!

2024-07-08 Thread Alon Zakai
Asyncify can definitely be very slow in some cases, yeah, in large programs. If you can't use JSPI in production yet you can at least use it in local testing at least, for much faster iteration. On Mon, Jul 8, 2024 at 12:40 PM 'Sam Clegg' via emscripten-discuss < emscripten-discuss@googlegroups.c

Re: Optimization takes a long time!!

2024-07-08 Thread 'Sam Clegg' via emscripten-discuss
It seems that what is slow here is the `--asyncify` pass in wasm-opt. IIUC that pass will be slower or faster depending on how much of your program need to be asyncified. If you are using embind with asyncify I don't think you can avoid the need to asyncify calls to _emval_await so I'm not sure w

Re: Identification of malloc and free

2024-07-08 Thread 'Sam Clegg' via emscripten-discuss
Hi Ngula, In emscripten the allocators such as dlmalloc and emmalloc use `sbrk()` when they run out of memory. `sbrk()` then calls `emscripten_resize_heap`, which by default will abort with an error message here: https://github.com/emscripten-core/emscripten/blob/b3c25673f53974ff1f30df43701dc63a

Identification of malloc and free

2024-07-08 Thread NgulaDE
Hey, I am working on a patcher for Wasm. Is there a way to identify the malloc and the free function of the dlmalloc and emmalloc allocator? My supervisor says that malloc prints an error message, such as "out of memory", "allocation failed" or "insufficient memory", if memory allocation via mal