Closed dmonad closed 7 months ago
Issue is in factory.applyUpdate
: https://github.com/dmonad/crdt-benchmarks/blob/8203fde042bddb486f0387957cafb1dd94eb3dac/benchmarks/ywasm/factory.js#L62-L64
ywasm Y.applyUpdateV2(this.ydoc, update)
creates a new write transaction. However this method is always executed within the doc.transact
context which already had created a write transaction before. Since two write transaction cannot exist at the same time an exception happens (however I agree that there should be more human-friendly error message).
I'll send fixes soon.
I'm also adding my results - last column is raw yrs (using cargo criterion
), which is only for loose reference and to observe JS<->WASM barrier overhead, as tool and its methodology are different:
yjs | ywasm | yrs | |
---|---|---|---|
yjs [B1.1] Append N characters (time) | 189 ms | 110 ms | 13 ms |
yjs [B1.2] Insert string of length N (time) | 0 ms | 0 ms | 0ms |
yjs [B1.3] Prepend N characters (time) | 125 ms | 28 ms | 5ms |
yjs [B1.4] Insert N characters at random positions (time) | 131 ms | 110 ms | 70ms |
yjs [B1.5] Insert N words at random positions (time) | 136 ms | 294 ms | 22ms |
yjs [B1.6] Insert string, then delete it (time) | 1 ms | 1 ms | |
yjs [B1.7] Insert/Delete strings at random positions (time) | 156 ms | 108 ms | 365ms |
yjs [B1.8] Append N numbers (time) | 159 ms | 34 ms | 5ms |
yjs [B1.9] Insert Array of N numbers (time) | 0 ms | 1 ms | 0ms |
yjs [B1.10] Prepend N numbers (time) | 114 ms | 30 ms | 13ms |
yjs [B1.11] Insert N numbers at random positions (time) | 124 ms | 144 ms | 70ms |
yjs [B2.1] Concurrently insert string of length N at index 0 (time) | 1 ms | 0 ms | 0ms |
yjs [B2.2] Concurrently insert N characters at random positions (time) | 33 ms | 327 ms | 205ms |
yjs [B2.3] Concurrently insert N words at random positions (time) | 57 ms | 785 ms | 400ms |
yjs [B2.4] Concurrently insert & delete (time) | 129 ms | 2807 ms | 630ms |
yjs [B3.1] 20√N clients concurrently set number in Map (time) | 75 ms | 206 ms | 27ms |
yjs [B3.2] 20√N clients concurrently set Object in Map (time) | 79 ms | 197 ms | 30ms |
yjs [B3.3] 20√N clients concurrently set String in Map (time) | 224 ms | 206 ms | 28ms |
yjs [B3.4] 20√N clients concurrently insert text in Array (time) | 68 ms | 226 ms | 27ms |
yjs [B4] Apply real-world editing dataset (time) | 5263 ms | 23980 ms | 5793ms |
We still can improve in many ways.
Hey @Horusiath,
I'm trying to bump Ywasm to the latest release.
I'm running into an issue when calling
applyUpdateV2
:I logged the input parameters for
applyUpdate
and the results look okay, nothing weird:Could you please help me debug the issue?
Just run
node run.js
inbenchmarks/ywasm/
.