nomad / cola Goto Github PK
View Code? Open in Web Editor NEW🥤 A text CRDT for real-time collaborative editing
Home Page: https://crates.io/crates/cola
License: MIT License
🥤 A text CRDT for real-time collaborative editing
Home Page: https://crates.io/crates/cola
License: MIT License
Hi! I'm taking a look at cola. Your g-tree data structure looks to be several times faster than the b-tree I have in diamond types - which is super impressive! I'm considering using it.
I just ran the test suite for cola and got a failure:
$ cargo test
...
Running tests/insertions.rs (target/debug/deps/insertions-53609808c6069dab)
running 5 tests
test conflicting_insertions_2 ... ok
test conflicting_insertions ... ok
test woot_figure_2 ... ok
test random_edits ... FAILED
test random_insertions ... ok
failures:
---- random_edits stdout ----
seed: 2497429969382240968
thread 'random_edits' panicked at /home/seph/3rdparty/cola/src/gtree.rs:1266:9:
assertion `left == right` failed
left: 547
right: 549
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
random_edits
test result: FAILED. 4 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 16.21s
But I can't reproduce the failure. I assume each testing run is using rng with a random seed, and the seed is discarded when the test fails.
Just browsed through the code and saw something:
You are using usize to encode and decode the length of a byte array. The number of bytes differs on different architectures, so decoding would fail on a 32 bit system if it was sent from a 64 bit system.
Why don't you just let bincode encode and decode the whole tuple of fields? It saves code and should be safer. You also need to think about security here, as it is supposed to be sent over the wire.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.