emscripten-core / emscripten-core/emscripten
Should addFunction grow the table less frequently?
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
Right now addFunction grows the wasm table by 1 every time it adds a new function. This seems like it could be a performance issue, since growing tables could invalidate jitcode by changing the range of valid indices, etc. Would it make sense to grow it in chunks, say 256 items at a time? It doesn't seem like the cost of using an extra say (let's be conservative here) `(32 * 255)` bytes of memory would be a problem. Is it a known thing that this isn't an issue?
I've been jitting wasm functions and importing them via addFunction and seeing mysterious perf issues, so I've been trying to track down the causes and this seemed like a possible factor.
Contributor guide
Assessment
This issue has not been assessed yet.