automerge icon indicating copy to clipboard operation
automerge copied to clipboard

Support WebAssembly Memory64

Open georgewsu opened this issue 10 months ago • 2 comments

With 32-bit wasm, automerge rust is limited to 4GB memory.

This limits the total number/size of documents that automerge-repo can retain in its handleCache, which in turn limits how many/large documents can be concurrently used in a sync server.

Node 24 released support for WebAssembly Memory64 (V8 engine version 13.6) https://nodejs.org/en/blog/release/v24.0.0

Node v24.3.0 uses v8 version 13.6.233.10 which supports 16GB https://chromium.googlesource.com/v8/v8/+/refs/tags/13.6.233.10/src/wasm/wasm-limits.h

georgewsu avatar Jun 25 '25 21:06 georgewsu

Note, if Node-API ships (https://github.com/automerge/automerge/pull/1099), that may be a better alternative.

georgewsu avatar Jun 25 '25 21:06 georgewsu

I think we'll need to wait for wasm64-unknown-unknown to be supported by wasm-bindgen. At that point it should be pretty straightforward to support Memory64 technically.

alexjg avatar Jun 26 '25 08:06 alexjg