dmonad / crdt-benchmarks

A collection of CRDT benchmarks
Other
454 stars 30 forks source link

Add benchmarks for Loro #24

Closed dmonad closed 9 months ago

dmonad commented 9 months ago

Hi @loro-dev, @zxch3n @Leeeon233,

After looking at the benchmarks at your website, I wanted to reproduce your results. Unfortunately, I can't find your fork of my benchmarking suite in your organization. So I integrated Loro in my benchmarking suite. Please feel free to maintain your benchmarks in this repository!

My benchmark results look very different from what you stated on your website. While you state that parseTime and time are almost (a lot) smaller than Yjs, I find the exact opposite here. In some cases, Loro seems to have exponential runtime behavior (e.g. in the B2 & B3 benchmarks, both time and parseTime increase exponentially with N). B4x100 takes several hours to execute, not just mere seconds as you stated.

Can you please explain the disparity between these results? Is there some hidden API that I'm supposed to use?

Below, I compiled a table that shows the disparity.

Disparity between benchmark results

N = 6000 loro loro-website
[B3.1] 20√N clients concurrently set number in Map (time) 1,895 ms 23 ms
[B3.1] 20√N clients concurrently set number in Map (updateSize) 161,636 bytes 63,850 bytes
[B3.1] 20√N clients concurrently set number in Map (encodeTime) 1 ms 2 ms
[B3.1] 20√N clients concurrently set number in Map (docSize) 21,487 bytes 38,464 bytes
[B3.1] 20√N clients concurrently set number in Map (parseTime) 4 ms 22 ms
[B3.2] 20√N clients concurrently set Object in Map (time) 2,008 ms 40 ms
[B3.2] 20√N clients concurrently set Object in Map (updateSize) 200,630 bytes 99,763 bytes
[B3.2] 20√N clients concurrently set Object in Map (encodeTime) 3 ms 3 ms
[B3.2] 20√N clients concurrently set Object in Map (docSize) 40,475 bytes 74,377 bytes
[B3.2] 20√N clients concurrently set Object in Map (parseTime) 24 ms 24 ms
[B3.3] 20√N clients concurrently set String in Map (time) 2,006 ms 100 ms
[B3.3] 20√N clients concurrently set String in Map (updateSize) 7,940,240 bytes 7,840,873 bytes
[B3.3] 20√N clients concurrently set String in Map (encodeTime) 47 ms 28 ms
[B3.3] 20√N clients concurrently set String in Map (docSize) 7,799,720 bytes 7,815,449 bytes
[B3.3] 20√N clients concurrently set String in Map (parseTime) 36 ms 7 ms
[B3.4] 20√N clients concurrently insert text in Array (time) 108,260 ms 28 ms
[B3.4] 20√N clients concurrently insert text in Array (updateSize) 166,750 bytes 70,476 bytes
[B3.4] 20√N clients concurrently insert text in Array (encodeTime) 2 ms 1 ms
[B3.4] 20√N clients concurrently insert text in Array (docSize) 28,140 bytes 47,868 bytes
[B3.4] 20√N clients concurrently insert text in Array (parseTime) 220 ms 5 ms
[B4] Apply real-world editing dataset (time) 1,264 ms 158 ms
[B4] Apply real-world editing dataset (encodeTime) 6 ms 2 ms
[B4] Apply real-world editing dataset (docSize) 229,732 bytes 260,815 bytes
[B4] Apply real-world editing dataset (parseTime) 77 ms 2 ms
[B4x100] Apply real-world editing dataset 100 times (time) hours.. 15,251 ms
[B4x100] Apply real-world editing dataset 100 times (encodeTime) skipped 222 ms
[B4x100] Apply real-world editing dataset 100 times (docSize) skipped 26,826,425 bytes
[B4x100] Apply real-world editing dataset 100 times (parseTime) skipped 180 ms

Loro Website Benchmarks (extracted January 23, 2024)

N = 6000 loro-wasm yjs automerge-wasm ywasm
[B1.1] Append N characters (time) 54 ms 86 ms 61 ms 72 ms
[B1.1] Append N characters (avgUpdateSize) 58 bytes 27 bytes 121 bytes 27 bytes
[B1.1] Append N characters (encodeTime) 0 ms 1 ms 7 ms 0 ms
[B1.1] Append N characters (docSize) 6219 bytes 6031 bytes 3995 bytes 6031 bytes
[B1.1] Append N characters (parseTime) 0 ms 0 ms 38 ms 0 ms
[B1.2] Insert string of length N (time) 0 ms 1 ms 28 ms 0 ms
[B1.2] Insert string of length N (avgUpdateSize) 6096 bytes 6031 bytes 6201 bytes 6031 bytes
[B1.2] Insert string of length N (encodeTime) 0 ms 2 ms 2 ms 0 ms
[B1.2] Insert string of length N (docSize) 6148 bytes 6031 bytes 3977 bytes 6031 bytes
[B1.2] Insert string of length N (parseTime) 0 ms 0 ms 12 ms 0 ms
[B1.3] Prepend N characters (time) 23 ms 73 ms 45 ms 16 ms
[B1.3] Prepend N characters (avgUpdateSize) 57 bytes 27 bytes 116 bytes 27 bytes
[B1.3] Prepend N characters (encodeTime) 1 ms 2 ms 8 ms 0 ms
[B1.3] Prepend N characters (docSize) 6165 bytes 6041 bytes 3991 bytes 6041 bytes
[B1.3] Prepend N characters (parseTime) 1 ms 5 ms 34 ms 1 ms
[B1.4] Insert N characters at random positions (time) 19 ms 68 ms 214 ms 80 ms
[B1.4] Insert N characters at random positions (avgUpdateSize) 58 bytes 29 bytes 121 bytes 29 bytes
[B1.4] Insert N characters at random positions (encodeTime) 1 ms 2 ms 8 ms 0 ms
[B1.4] Insert N characters at random positions (docSize) 29503 bytes 29554 bytes 24746 bytes 29554 bytes
[B1.4] Insert N characters at random positions (parseTime) 1 ms 3 ms 64 ms 3 ms
[B1.5] Insert N words at random positions (time) 20 ms 71 ms 986 ms 245 ms
[B1.5] Insert N words at random positions (avgUpdateSize) 63 bytes 36 bytes 131 bytes 36 bytes
[B1.5] Insert N words at random positions (encodeTime) 2 ms 3 ms 23 ms 1 ms
[B1.5] Insert N words at random positions (docSize) 98899 bytes 87924 bytes 96206 bytes 87924 bytes
[B1.5] Insert N words at random positions (parseTime) 2 ms 8 ms 144 ms 5 ms
[B1.6] Insert string, then delete it (time) 0 ms 5 ms 36 ms 0 ms
[B1.6] Insert string, then delete it (avgUpdateSize) 6191 bytes 6053 bytes 6338 bytes 6053 bytes
[B1.6] Insert string, then delete it (encodeTime) 0 ms 0 ms 4 ms 0 ms
[B1.6] Insert string, then delete it (docSize) 6143 bytes 38 bytes 3996 bytes 38 bytes
[B1.6] Insert string, then delete it (parseTime) 0 ms 0 ms 28 ms 0 ms
[B1.7] Insert/Delete strings at random positions (time) 28 ms 85 ms 763 ms 74 ms
[B1.7] Insert/Delete strings at random positions (avgUpdateSize) 61 bytes 31 bytes 135 bytes 31 bytes
[B1.7] Insert/Delete strings at random positions (encodeTime) 1 ms 7 ms 18 ms 0 ms
[B1.7] Insert/Delete strings at random positions (docSize) 51470 bytes 28377 bytes 59284 bytes 28377 bytes
[B1.7] Insert/Delete strings at random positions (parseTime) 1 ms 10 ms 112 ms 2 ms
[B1.8] Append N numbers (time) 23 ms 85 ms 146 ms 16 ms
[B1.8] Append N numbers (avgUpdateSize) 60 bytes 32 bytes 125 bytes 32 bytes
[B1.8] Append N numbers (encodeTime) 2 ms 1 ms 10 ms 0 ms
[B1.8] Append N numbers (docSize) 47623 bytes 35634 bytes 26988 bytes 35634 bytes
[B1.8] Append N numbers (parseTime) 3 ms 0 ms 68 ms 0 ms
[B1.9] Insert Array of N numbers (time) 5 ms 1 ms 24 ms 2 ms
[B1.9] Insert Array of N numbers (avgUpdateSize) 35725 bytes 35657 bytes 31199 bytes 35657 bytes
[B1.9] Insert Array of N numbers (encodeTime) 1 ms 1 ms 2 ms 0 ms
[B1.9] Insert Array of N numbers (docSize) 47648 bytes 35657 bytes 26956 bytes 35657 bytes
[B1.9] Insert Array of N numbers (parseTime) 3 ms 0 ms 23 ms 0 ms
[B1.10] Prepend N numbers (time) 16 ms 51 ms 382 ms 15 ms
[B1.10] Prepend N numbers (avgUpdateSize) 59 bytes 32 bytes 120 bytes 32 bytes
[B1.10] Prepend N numbers (encodeTime) 1 ms 1 ms 10 ms 0 ms
[B1.10] Prepend N numbers (docSize) 47643 bytes 35665 bytes 26990 bytes 35665 bytes
[B1.10] Prepend N numbers (parseTime) 3 ms 1 ms 51 ms 2 ms
[B1.11] Insert N numbers at random positions (time) 16 ms 58 ms 458 ms 113 ms
[B1.11] Insert N numbers at random positions (avgUpdateSize) 62 bytes 34 bytes 125 bytes 34 bytes
[B1.11] Insert N numbers at random positions (encodeTime) 1 ms 2 ms 12 ms 0 ms
[B1.11] Insert N numbers at random positions (docSize) 70903 bytes 59137 bytes 47749 bytes 59137 bytes
[B1.11] Insert N numbers at random positions (parseTime) 3 ms 3 ms 70 ms 3 ms
[B2.1] Concurrently insert string of length N at index 0 (time) 0 ms 0 ms 104 ms 0 ms
[B2.1] Concurrently insert string of length N at index 0 (updateSize) 9256 bytes 6094 bytes 9499 bytes 6093 bytes
[B2.1] Concurrently insert string of length N at index 0 (encodeTime) 0 ms 0 ms 4 ms 0 ms
[B2.1] Concurrently insert string of length N at index 0 (docSize) 12282 bytes 12152 bytes 8014 bytes 12150 bytes
[B2.1] Concurrently insert string of length N at index 0 (parseTime) 0 ms 0 ms 43 ms 0 ms
[B2.2] Concurrently insert N characters at random positions (time) 117 ms 25 ms 1496 ms 210 ms
[B2.2] Concurrently insert N characters at random positions (updateSize) 344345 bytes 33444 bytes 1093293 bytes 177007 bytes
[B2.2] Concurrently insert N characters at random positions (encodeTime) 1 ms 2 ms 18 ms 1 ms
[B2.2] Concurrently insert N characters at random positions (docSize) 59356 bytes 66860 bytes 50708 bytes 66852 bytes
[B2.2] Concurrently insert N characters at random positions (parseTime) 2 ms 15 ms 142 ms 6 ms
[B2.3] Concurrently insert N words at random positions (time) 144 ms 55 ms 2915 ms 569 ms
[B2.3] Concurrently insert N words at random positions (updateSize) 408728 bytes 88994 bytes 1185202 bytes 215213 bytes
[B2.3] Concurrently insert N words at random positions (encodeTime) 3 ms 4 ms 48 ms 4 ms
[B2.3] Concurrently insert N words at random positions (docSize) 197284 bytes 178130 bytes 191500 bytes 178130 bytes
[B2.3] Concurrently insert N words at random positions (parseTime) 3 ms 13 ms 311 ms 11 ms
[B2.4] Concurrently insert & delete (time) 259 ms 95 ms 5682 ms 1500 ms
[B2.4] Concurrently insert & delete (updateSize) 786130 bytes 139517 bytes 2395876 bytes 398881 bytes
[B2.4] Concurrently insert & delete (encodeTime) 4 ms 6 ms 87 ms 5 ms
[B2.4] Concurrently insert & delete (docSize) 304590 bytes 279166 bytes 307364 bytes 279172 bytes
[B2.4] Concurrently insert & delete (parseTime) 4 ms 27 ms 444 ms 32 ms
[B3.1] 20√N clients concurrently set number in Map (time) 23 ms 52 ms 35 ms 156 ms
[B3.1] 20√N clients concurrently set number in Map (updateSize) 63850 bytes 49163 bytes 283296 bytes 49172 bytes
[B3.1] 20√N clients concurrently set number in Map (encodeTime) 2 ms 2 ms 13 ms 1 ms
[B3.1] 20√N clients concurrently set number in Map (docSize) 38464 bytes 32212 bytes 83205 bytes 32214 bytes
[B3.1] 20√N clients concurrently set number in Map (parseTime) 22 ms 14 ms 38 ms 10 ms
[B3.2] 20√N clients concurrently set Object in Map (time) 40 ms 50 ms 42 ms 156 ms
[B3.2] 20√N clients concurrently set Object in Map (updateSize) 99763 bytes 85077 bytes 325370 bytes 85083 bytes
[B3.2] 20√N clients concurrently set Object in Map (encodeTime) 3 ms 2 ms 20 ms 1 ms
[B3.2] 20√N clients concurrently set Object in Map (docSize) 74377 bytes 32223 bytes 90426 bytes 32240 bytes
[B3.2] 20√N clients concurrently set Object in Map (parseTime) 24 ms 13 ms 34 ms 11 ms
[B3.3] 20√N clients concurrently set String in Map (time) 100 ms 70 ms 215 ms 167 ms
[B3.3] 20√N clients concurrently set String in Map (updateSize) 7840873 bytes 7826231 bytes 8063440 bytes 7826231 bytes
[B3.3] 20√N clients concurrently set String in Map (encodeTime) 28 ms 2 ms 52 ms 2 ms
[B3.3] 20√N clients concurrently set String in Map (docSize) 7815449 bytes 38369 bytes 95086 bytes 36840 bytes
rt & delete (parseTime) 4 ms 27 ms 444 ms 32 ms
[B3.1] 20√N clients concurrently set number in Map (time) 23 ms 52 ms 35 ms 156 ms
[B3.1] 20√N clients concurrently set number in Map (updateSize) 63850 bytes 49163 bytes 283296 bytes 49172 bytes
[B3.1] 20√N clients concurrently set number in Map (encodeTime) 2 ms 2 ms 13 ms 1 ms
[B3.1] 20√N clients concurrently set number in Map (docSize) 38464 bytes 32212 bytes 83205 bytes 32214 bytes
[B3.1] 20√N clients concurrently set number in Map (parseTime) 22 ms 14 ms 38 ms 10 ms
[B3.2] 20√N clients concurrently set Object in Map (time) 40 ms 50 ms 42 ms 156 ms
[B3.2] 20√N clients concurrently set Object in Map (updateSize) 99763 bytes 85077 bytes 325370 bytes 85083 bytes
[B3.2] 20√N clients concurrently set Object in Map (encodeTime) 3 ms 2 ms 20 ms 1 ms
[B3.2] 20√N clients concurrently set Object in Map (docSize) 74377 bytes 32223 bytes 90426 bytes 32240 bytes
[B3.2] 20√N clients concurrently set Object in Map (parseTime) 24 ms 13 ms 34 ms 11 ms
[B3.3] 20√N clients concurrently set String in Map (time) 100 ms 70 ms 215 ms 167 ms
[B3.3] 20√N clients concurrently set String in Map (updateSize) 7840873 bytes 7826231 bytes 8063440 bytes 7826231 bytes
[B3.3] 20√N clients concurrently set String in Map (encodeTime) 28 ms 2 ms 52 ms 2 ms
[B3.3] 20√N clients concurrently set String in Map (docSize) 7815449 bytes 38369 bytes 95086 bytes 36840 bytes
[B3.3] 20√N clients concurrently set String in Map (parseTime) 7 ms 13 ms 74 ms 14 ms
[B3.4] 20√N clients concurrently insert text in Array (time) 28 ms 44 ms 33 ms 165 ms
[B3.4] 20√N clients concurrently insert text in Array (updateSize) 70476 bytes 52745 bytes 285330 bytes 52737 bytes
[B3.4] 20√N clients concurrently insert text in Array (encodeTime) 1 ms 2 ms 19 ms 1 ms
[B3.4] 20√N clients concurrently insert text in Array (docSize) 47868 bytes 26590 bytes 83577 bytes 26582 bytes
[B3.4] 20√N clients concurrently insert text in Array (parseTime) 5 ms 2 ms 41 ms 4 ms
[B4] Apply real-world editing dataset (time) 158 ms 1028 ms 1542 ms 23006 ms
[B4] Apply real-world editing dataset (avgUpdateSize) skipped 29 bytes skipped skipped
[B4] Apply real-world editing dataset (encodeTime) 2 ms 4 ms 131 ms 3 ms
[B4] Apply real-world editing dataset (docSize) 260815 bytes 159929 bytes 129098 bytes 159929 bytes
[B4] Apply real-world editing dataset (parseTime) 2 ms 6 ms 615 ms 14 ms
[B4x100] Apply real-world editing dataset 100 times (time) 15251 ms 110404 ms skipped skipped
[B4x100] Apply real-world editing dataset 100 times (encodeTime) 222 ms 266 ms skipped skipped
[B4x100] Apply real-world editing dataset 100 times (docSize) 26826425 bytes 15989245 bytes skipped skipped
[B4x100] Apply real-world editing dataset 100 times (parseTime) 180 ms 1357 ms skipped skipped
zxch3n commented 9 months ago

Hi @dmonad!

Thanks for diving into this. I've created a PR to fix the implementation #25

Latest Loro Benchmark Results Ran on a 13-inch M1 MacBook Pro 2020 |N = 6000 | loro| | :- | -: | |Version | 0.10.1 | |Bundle size | 1,052,250 bytes | |Bundle size (gzipped) | 399,686 bytes | |[B1.1] Append N characters (time) | 218 ms | |[B1.1] Append N characters (avgUpdateSize) | 109 bytes | |[B1.1] Append N characters (encodeTime) | 0 ms | |[B1.1] Append N characters (docSize) | 6,162 bytes | |[B1.1] Append N characters (memUsed) | 353.1 kB | |[B1.1] Append N characters (parseTime) | 45 ms | |[B1.2] Insert string of length N (time) | 0 ms | |[B1.2] Insert string of length N (avgUpdateSize) | 6,107 bytes | |[B1.2] Insert string of length N (encodeTime) | 0 ms | |[B1.2] Insert string of length N (docSize) | 6,117 bytes | |[B1.2] Insert string of length N (memUsed) | 0 B | |[B1.2] Insert string of length N (parseTime) | 40 ms | |[B1.3] Prepend N characters (time) | 49 ms | |[B1.3] Prepend N characters (avgUpdateSize) | 108 bytes | |[B1.3] Prepend N characters (encodeTime) | 16 ms | |[B1.3] Prepend N characters (docSize) | 12,125 bytes | |[B1.3] Prepend N characters (memUsed) | 0 B | |[B1.3] Prepend N characters (parseTime) | 54 ms | |[B1.4] Insert N characters at random positions (time) | 39 ms | |[B1.4] Insert N characters at random positions (avgUpdateSize) | 109 bytes | |[B1.4] Insert N characters at random positions (encodeTime) | 23 ms | |[B1.4] Insert N characters at random positions (docSize) | 35,401 bytes | |[B1.4] Insert N characters at random positions (memUsed) | 0 B | |[B1.4] Insert N characters at random positions (parseTime) | 33 ms | |[B1.5] Insert N words at random positions (time) | 38 ms | |[B1.5] Insert N words at random positions (avgUpdateSize) | 117 bytes | |[B1.5] Insert N words at random positions (encodeTime) | 46 ms | |[B1.5] Insert N words at random positions (docSize) | 94,524 bytes | |[B1.5] Insert N words at random positions (memUsed) | 0 B | |[B1.5] Insert N words at random positions (parseTime) | 31 ms | |[B1.6] Insert string, then delete it (time) | 1 ms | |[B1.6] Insert string, then delete it (avgUpdateSize) | 6,217 bytes | |[B1.6] Insert string, then delete it (encodeTime) | 0 ms | |[B1.6] Insert string, then delete it (docSize) | 6,120 bytes | |[B1.6] Insert string, then delete it (memUsed) | 2.6 kB | |[B1.6] Insert string, then delete it (parseTime) | 29 ms | |[B1.7] Insert/Delete strings at random positions (time) | 46 ms | |[B1.7] Insert/Delete strings at random positions (avgUpdateSize) | 113 bytes | |[B1.7] Insert/Delete strings at random positions (encodeTime) | 11 ms | |[B1.7] Insert/Delete strings at random positions (docSize) | 50,836 bytes | |[B1.7] Insert/Delete strings at random positions (memUsed) | 0 B | |[B1.7] Insert/Delete strings at random positions (parseTime) | 27 ms | |[B1.8] Append N numbers (time) | 41 ms | |[B1.8] Append N numbers (avgUpdateSize) | 114 bytes | |[B1.8] Append N numbers (encodeTime) | 1 ms | |[B1.8] Append N numbers (docSize) | 35,719 bytes | |[B1.8] Append N numbers (memUsed) | 0 B | |[B1.8] Append N numbers (parseTime) | 33 ms | |[B1.9] Insert Array of N numbers (time) | 9 ms | |[B1.9] Insert Array of N numbers (avgUpdateSize) | 35,735 bytes | |[B1.9] Insert Array of N numbers (encodeTime) | 1 ms | |[B1.9] Insert Array of N numbers (docSize) | 35,742 bytes | |[B1.9] Insert Array of N numbers (memUsed) | 0 B | |[B1.9] Insert Array of N numbers (parseTime) | 28 ms | |[B1.10] Prepend N numbers (time) | 40 ms | |[B1.10] Prepend N numbers (avgUpdateSize) | 113 bytes | |[B1.10] Prepend N numbers (encodeTime) | 6 ms | |[B1.10] Prepend N numbers (docSize) | 41,748 bytes | |[B1.10] Prepend N numbers (memUsed) | 0 B | |[B1.10] Prepend N numbers (parseTime) | 28 ms | |[B1.11] Insert N numbers at random positions (time) | 39 ms | |[B1.11] Insert N numbers at random positions (avgUpdateSize) | 114 bytes | |[B1.11] Insert N numbers at random positions (encodeTime) | 24 ms | |[B1.11] Insert N numbers at random positions (docSize) | 65,016 bytes | |[B1.11] Insert N numbers at random positions (memUsed) | 0 B | |[B1.11] Insert N numbers at random positions (parseTime) | 28 ms | |[B2.1] Concurrently insert string of length N at index 0 (time) | 1 ms | |[B2.1] Concurrently insert string of length N at index 0 (updateSize) | 9,276 bytes | |[B2.1] Concurrently insert string of length N at index 0 (encodeTime) | 0 ms | |[B2.1] Concurrently insert string of length N at index 0 (docSize) | 12,248 bytes | |[B2.1] Concurrently insert string of length N at index 0 (memUsed) | 1.9 kB | |[B2.1] Concurrently insert string of length N at index 0 (parseTime) | 28 ms | |[B2.2] Concurrently insert N characters at random positions (time) | 204 ms | |[B2.2] Concurrently insert N characters at random positions (updateSize) | 665,563 bytes | |[B2.2] Concurrently insert N characters at random positions (encodeTime) | 57 ms | |[B2.2] Concurrently insert N characters at random positions (docSize) | 71,858 bytes | |[B2.2] Concurrently insert N characters at random positions (memUsed) | 0 B | |[B2.2] Concurrently insert N characters at random positions (parseTime) | 53 ms | |[B2.3] Concurrently insert N words at random positions (time) | 213 ms | |[B2.3] Concurrently insert N words at random positions (updateSize) | 731,420 bytes | |[B2.3] Concurrently insert N words at random positions (encodeTime) | 98 ms | |[B2.3] Concurrently insert N words at random positions (docSize) | 188,458 bytes | |[B2.3] Concurrently insert N words at random positions (memUsed) | 0 B | |[B2.3] Concurrently insert N words at random positions (parseTime) | 49 ms | |[B2.4] Concurrently insert & delete (time) | 427 ms | |[B2.4] Concurrently insert & delete (updateSize) | 1,441,427 bytes | |[B2.4] Concurrently insert & delete (encodeTime) | 155 ms | |[B2.4] Concurrently insert & delete (docSize) | 289,590 bytes | |[B2.4] Concurrently insert & delete (memUsed) | 0 B | |[B2.4] Concurrently insert & delete (parseTime) | 53 ms | |[B3.1] 20√N clients concurrently set number in Map (time) | 43 ms | |[B3.1] 20√N clients concurrently set number in Map (updateSize) | 161,636 bytes | |[B3.1] 20√N clients concurrently set number in Map (encodeTime) | 3 ms | |[B3.1] 20√N clients concurrently set number in Map (docSize) | 21,506 bytes | |[B3.1] 20√N clients concurrently set number in Map (memUsed) | 0 B | |[B3.1] 20√N clients concurrently set number in Map (parseTime) | 46 ms | |[B3.2] 20√N clients concurrently set Object in Map (time) | 50 ms | |[B3.2] 20√N clients concurrently set Object in Map (updateSize) | 200,630 bytes | |[B3.2] 20√N clients concurrently set Object in Map (encodeTime) | 3 ms | |[B3.2] 20√N clients concurrently set Object in Map (docSize) | 40,494 bytes | |[B3.2] 20√N clients concurrently set Object in Map (memUsed) | 584 B | |[B3.2] 20√N clients concurrently set Object in Map (parseTime) | 75 ms | |[B3.3] 20√N clients concurrently set String in Map (time) | 115 ms | |[B3.3] 20√N clients concurrently set String in Map (updateSize) | 7,940,240 bytes | |[B3.3] 20√N clients concurrently set String in Map (encodeTime) | 46 ms | |[B3.3] 20√N clients concurrently set String in Map (docSize) | 7,798,572 bytes | |[B3.3] 20√N clients concurrently set String in Map (memUsed) | 488 B | |[B3.3] 20√N clients concurrently set String in Map (parseTime) | 51 ms | |[B3.4] 20√N clients concurrently insert text in Array (time) | 154 ms | |[B3.4] 20√N clients concurrently insert text in Array (updateSize) | 166,750 bytes | |[B3.4] 20√N clients concurrently insert text in Array (encodeTime) | 9 ms | |[B3.4] 20√N clients concurrently insert text in Array (docSize) | 31,098 bytes | |[B3.4] 20√N clients concurrently insert text in Array (memUsed) | 0 B | |[B3.4] 20√N clients concurrently insert text in Array (parseTime) | 52 ms | |[B4] Apply real-world editing dataset (time) | 191 ms | |[B4] Apply real-world editing dataset (encodeTime) | 49 ms | |[B4] Apply real-world editing dataset (docSize) | 258,228 bytes | |[B4] Apply real-world editing dataset (parseTime) | 8 ms | |[B4] Apply real-world editing dataset (memUsed) | 0 B | |[B4x100] Apply real-world editing dataset 100 times (time) | 20,540 ms | |[B4x100] Apply real-world editing dataset 100 times (encodeTime) | 9,445 ms | |[B4x100] Apply real-world editing dataset 100 times (docSize) | 25,805,795 bytes | |[B4x100] Apply real-world editing dataset 100 times (parseTime) | 852 ms | |[B4x100] Apply real-world editing dataset 100 times (memUsed) | 2.8 kB |

However, you can still see some discrepancies with the numbers reported on the website because the website reports benchmark data for the version dated 2023-11-08. Over the past two months, we've done a lot of refactoring and adjustments, the most significant of which is the change in our encoding format https://github.com/loro-dev/loro/pull/219. Additionally, we switched the compilation optimization level (opt-level) for WASM from 3 to 's', which may result in some performance trade-offs for a smaller WASM size. These refactorings will lead to changes in many performance metrics, and we have not yet embarked on more specific optimization work.

I think it's fair to use exportSnapshot during encoding because Loro's exportSnapshot actually serves a similar purpose to Automerge's save. It efficiently encodes both state and history, so in terms of document size, it's similar to exportUpdates. Our method is not exporting the internal memory representation; if it were, the document size would likely be much larger.

dmonad commented 9 months ago

Thank you for clearing that up!

You are right, it's fair to use exportSnapshot, since I also do so for Automerge.

I published fresh benchmarking results in the readme. Today I realized how much slower my machine is to current M1's. But maybe that's a good thing, my 7 year old CPU reflects "normal users" much better.