Fixed some typos in the bft-json-crdt crate readme.

This commit is contained in:
Dave Hrycyszyn
2024-05-30 14:15:37 +01:00
parent f8b932b561
commit e0667d37f9

View File

@@ -13,9 +13,9 @@ Unlike most other CRDT implementations, I leave out many performance optimizatio
Check out the [accompanying blog post for this project!](https://jzhao.xyz/posts/bft-json-crdt) Check out the [accompanying blog post for this project!](https://jzhao.xyz/posts/bft-json-crdt)
## Benchmarks ## Benchmarks
Altough this implementation does not optimize for performance, it still nonetheless performs quite well. Although this implementation does not optimize for performance, it still nonetheless performs quite well.
Benchmarking happened on a 2019 Macbook Pro with a 2.6GHz i7. Benchmarking happened on a 2019 MacBook Pro with a 2.6GHz i7.
Numbers are compared to Automerge which report their performance benchmarks [here](https://github.com/automerge/automerge-perf) Numbers are compared to Automerge which report their performance benchmarks [here](https://github.com/automerge/automerge-perf)
| # Ops | Raw String (JS) | Ours (basic) | Ours (BFT) | Automerge (JS) | Automerge (Rust) | | # Ops | Raw String (JS) | Ours (basic) | Ours (BFT) | Automerge (JS) | Automerge (Rust) |
@@ -38,7 +38,7 @@ This is mostly a learning/instructional project but there are a few places where
1. This is backed by `std::Vec` which isn't great for random insert. Replace with a B-tree or something that provides better insert and find performance 1. This is backed by `std::Vec` which isn't great for random insert. Replace with a B-tree or something that provides better insert and find performance
1. [Diamond Types](https://github.com/josephg/diamond-types) and [Automerge (Rust)](https://github.com/automerge/automerge-rs) use a B-tree 1. [Diamond Types](https://github.com/josephg/diamond-types) and [Automerge (Rust)](https://github.com/automerge/automerge-rs) use a B-tree
2. Yjs is backed by a doubly linked-list and caches last ~5-10 accessed locations (assumes that most edits happen sequentially; seeks are rare) 2. Yjs is backed by a doubly linked-list and caches last ~5-10 accessed locations (assumes that most edits happen sequentially; seeks are rare)
3. (funnily enough, main peformance hit is dominated by find and not insert, see [this flamegraph](./flamegraphs/flamegraph_unoptimized.svg)) 3. (funnily enough, main performance hit is dominated by find and not insert, see [this flamegraph](./flamegraphs/flamegraph_unoptimized.svg))
2. Avoid calling `find` so many times. A few Automerge optimizations that were not implemented 2. Avoid calling `find` so many times. A few Automerge optimizations that were not implemented
1. Use an index hint (especially for local inserts) 1. Use an index hint (especially for local inserts)
2. Skipping the second `find` operation in `integrate` if sequence number is already larger 2. Skipping the second `find` operation in `integrate` if sequence number is already larger