This demo imports the complete history of the Loro repo into the latest version of Loro. The document opened here stores the full editing history of this file, allowing for smooth transitions between file histories. With sufficiently fast backtracking and version switching, we can reimagine interaction modes for Timeline, Undo/Redo, and version management

This demo imports the complete history of the Loro repo into the latest version of Loro. The document opened here stores the full editing history of this file, allowing for smooth transitions between file histories. With sufficiently fast backtracking and version switching, we can reimagine interaction modes for Timeline, Undo/Redo, and version management

Loro 1.0 Change Summary

Here's a speed comparison of Snapshot import and export between versions 1.0 and 0.16.12. The benchmark uses real-world document editing history, with data kindly provided by latch.bio. You can find the benchmark code at https://github.com/loro-dev/latch-bench. The documents contain 1,659,541 operations.

In Loro, a snapshot stores both the document history and its current state. The shallow snapshot format, similar to Git's shallow clone, allows for the removal of historical data. In this benchmark, the shallow snapshot has a depth of 1 (keeping only the most recent operation history, with older operations removed).

name task avg. time
0 Old Snapshot Format on 0.16.12 Import 15.688953ms +- 10.263µs
Import+GetAllValues 15.781199ms +- 12.296µs
Import+GetAllValues+Edit 15.916294ms +- 113.443µs
Import+GetAllValues+Edit+Expo 30.2621ms +- 32.936µs
2 New Snapshot Format on 1.0.0-beta.1 Import 906.097µs +- 23.672µs
Import+GetAllValues 880.976µs +- 25.544µs
Import+GetAllValues+Edit 773.657µs +- 23.585µs
Import+GetAllValues+Edit+Export 4.102005ms +- 92.102µs
3 Shallow Snapshot Format on 1.0.0-beta.1 Import 255.449µs +- 9.661µs
Import+GetAllValues 185.39µs +- 10.48µs
Import+GetAllValues+Edit 225.466µs +- 10.787µs
Import+GetAllValues+Edit+Export 581.245µs +- 17.223µs

For more detailed interface change information, check Loro v0.16 到 v1.0.0-beta 变动

Introduction to Eg-walker

Loro's algorithm architecture has been greatly inspired by the Eg-walker algorithm, so it is very similar to Eg-walker in terms of algorithm properties.

The Eg-walker paper was published in September 2024. It combines the advantages of both CRDT and OT algorithms, while achieving the following points:

<aside> 💡

Differences between Loro and Eg-walker

In terms of performance, Loro and Eg-walker have similar local editing and remote operation merging performance. Eg-walker has an advantage in import performance because Loro's encoding format carries additional ID information and integrity checks, resulting in larger volume and slower import.