3 ms·
Yeah, this is unfortunately a big pain point right now. Every time you click "compile" we allocate a new Wasm memory to use for running the optimizer. But garba
by sestep 3y ago
Yeah, this is unfortunately a big pain point right now. Every time you click "compile" we allocate a new Wasm memory to use for running the optimizer. But garbage collectors in current browsers get confused when there are lots of these large Wasm memories floating around; I'm not entirely sure why, but I think it's because the GC engine doesn't correctly conceptualize how big the Wasm memories actually are, so they don't try to collect them as aggressively as they should. We're currently seeing if we can alleviate this issue by reusing the Wasm memory from compile to compile, but that's a bit tricky in the presence of concurrency (we're also trying to move computation from the main thread into a web worker). In future versions, we might try to sidestep this issue by just using the new Wasm GC that landed in Chrome recently, but for that we'd probably have to wait a bit longer until it's also supported in, e.g., mobile Safari.