Yjs vs Loro (new CRDT lib)

Links in the post are removed. Otherwise, the community will flag the post as spam

I am the author of Loro. The latest benchmark data can be found at this address: github zxch3n/crdt-benchmarks, which includes the most recent Loro benchmark data as well as the November 2023 version of Loro’s benchmark data, which you can easily reproduce. Over the past few months, Loro has undergone numerous changes, especially in the encoding format, shifting from a version focused more on performance to one emphasizing compatibility, resulting in performance differences loro-dev/loro/pull/219. We also have experimental work underway that may significantly change performance in the near future, so even the current benchmarks on Loro are not stable.

For a fairer comparison of Yjs and Loro in this benchmark, Yjs should turn off garbage collection because Loro and Automerge’s documents record the complete editing history, whereas Yjs in GC mode does not. Even with GC disabled, Yjs cannot directly implement Time Travel, whereas Loro and Automerge can.

Regarding package size, it’s true that the WASM size is larger. However, it’s important to consider the context. Most use cases for CRDTs are in web apps, not web pages. In this scenario, caching can be fully utilized, and items like WASM binaries do not require frequent updates. Additionally, WASM binaries do not need to be embedded in the JavaScript source code as Base64, which can misleadingly suggest a 30% increase in size due to encoding. They can be loaded as separate files. If there’s a strong community demand for a lightweight library, we will explore a mode based on Loro’s REG algorithm features. This mode would rely on server-side conflict resolution computation, where the client only needs a lightweight JS library to log operations and apply diffs.

If you have any questions, please email me directly or ask in our community. I greatly appreciate the work of Yjs and have even sponsored Kevin for over a year. We have given Yjs credits in our README, and I have supported Kevin when he tried to reproduce our results, explaining why there are performance differences with the original version. I had hoped for a more friendly community. The insinuations in this discussion made me upset and disappointed.

2 Likes