Commit graph

402 commits

Author SHA1 Message Date
Andrew Jeffery
e71f6964a4 Use static_assertions to test for Send+Sync 2021-07-04 10:23:12 +01:00
Andrew Jeffery
066c955370 Remove event handlers
These were to capture changes before they were applied but since there
is no queue now it is deterministic when they will be applied.
2021-07-04 10:04:51 +01:00
Andrew Jeffery
9dcafaeac4 Remove queue from backend
This also adds a check for any missing dependencies when applying the
changes.
2021-07-04 09:25:50 +01:00
Orion Henry
3db6f9ef13
Fix Clippy issues, broken tests, formatting issues (#188)
* fix clippy errors

* Bump travis nvm version

* Add smol_str arbitrary

* Fix Err prefix clippy error

* Fix clippy needless-borrow

* Ensure SortedVec sorts on deserialize

Co-authored-by: Andrew Jeffery <dev@jeffas.io>
2021-06-28 13:20:21 +01:00
Andrew Jeffery
14d92e513c
Stop non-empty needs repeating messages (#193) 2021-06-27 14:59:23 +01:00
Vedant Roy
ca638691d0 Tests pass after rebase 2021-06-25 11:06:25 -07:00
Vedant Roy
aecfcf2c87 Rebase + clippy 2021-06-25 11:06:25 -07:00
Vedant Roy
338ec28992 Satisfy clippy 2021-06-25 11:06:25 -07:00
Vedant Roy
b82463bb87 Tests pass 2021-06-25 11:06:25 -07:00
Vedant Roy
a3a9d0b1fb condense_insert_ops failing 2021-06-25 11:06:25 -07:00
Vedant Roy
9353ae40b2 Remove F32 2021-06-25 11:06:25 -07:00
Vedant Roy
d35fc961e9 Ensure values have same type when constructing MultiElementInsert 2021-06-25 11:06:25 -07:00
Andrew Jeffery
08fd039eb3
Reduce use of new features to build on older Rusts (#184) 2021-06-25 16:03:13 +01:00
Andrew Jeffery
fe5a9a816d
Cleanup ColumnOp in backend and use sort_unstable (#187)
* Use sort_unstable_by for sorting columns

* Use ExpandedOp directly in ColumnEncoder
2021-06-25 14:20:34 +01:00
Andrew Jeffery
1383068064
Backend rearrangements (#177)
* Add SortedVec struct to ensure preds are sorted

* Add into_iter for sortedvec

* Specify capacity of bytes

* Pass docops by value

* Use Cow for operation keys

* More preallocation

* Use swap remove instead of remove to avoid O(n)

* Use default compression level for better balance of performance

* Remove result for incorporate_new_op

* Import actor once

* Allocate for the new value too in LiteralRun

The literalrun will finish with pushing the new `value` onto the vec so
we can allocate for that from the start.

* Set capacity of rangemap

* Preallocate data
2021-06-19 17:26:56 +01:00
Andrew Jeffery
987263b25d
Add SortedVec struct to ensure preds are sorted (#176)
* Add SortedVec struct to ensure preds are sorted

* Add into_iter for sortedvec
2021-06-19 17:25:25 +01:00
Andrew Jeffery
fc1b8f87fb
Use SmolStr in place of String (#182)
Most of the strings are small and so fit nicely in a SmolStr. When they
don't it just reverts to using a normal String.
2021-06-19 16:28:51 +01:00
Andrew Jeffery
ff8b8613d5
Flatten objtype (#175)
* Flatten object type

* Use separate construct functions

* Use separate gen_*_diff functions

* Remove maptype and seqtype from Diffs

* Preallocate ops in new_map_or_table

* More preallocations
2021-06-17 20:06:10 +01:00
Andrew Jeffery
79239cc6a4
Improve load performance when no cursors are present (#171)
* Add save and load to benchmarks

* Improve load performance when no cursors are found
2021-06-16 11:50:49 +01:00
Andrew Jeffery
8b3938c2e7
Rename UncompressedChange to Change (#173)
It wasn't really uncompressed as we have compressed and uncompressed
changes in the backend. It is just not encoded into the binary format.
The module separation (protocol vs backend) should help with the
distinction.
2021-06-16 11:50:26 +01:00
Andrew Jeffery
71b59dea68
Set levels for instrument (#164) 2021-06-14 23:34:35 +01:00
Orion Henry
647b8d2af2 fix deflate column decode order 2021-06-12 15:01:38 -07:00
Orion Henry
d8a56d966e added binary search to doc decode for big speedup 2021-05-29 13:34:03 -07:00
Andrew Jeffery
e98ed15582 Sort predecessors during encoding 2021-05-25 11:29:25 +01:00
Orion Henry
72d15bfe99 a few things broke in the merge 2021-05-24 16:27:05 -04:00
Vedant Roy
aaccefcb11 Switch back to using Vec<u8> 2021-05-24 13:17:37 -07:00
Vedant Roy
bc249bb630 Fix serialization + add test 2021-05-24 13:17:37 -07:00
Vedant Roy
22af56b059 Internal representation = base64 string 2021-05-24 13:17:37 -07:00
Vedant Roy
41021f398f Add bytes type 2021-05-24 13:17:37 -07:00
Vedant Roy
73bc44edbc Add comments from JS version 2021-05-24 13:15:20 -07:00
Vedant Roy
e694370733 Fix inverted bool + return correct data + remove serde 2021-05-24 13:15:20 -07:00
Vedant Roy
2c51761d01 Implement getAddedChanges 2021-05-24 13:15:20 -07:00
Orion Henry
6ebb63bfdd Merge branch 'main' into implement-new-sequence-patch-format 2021-05-24 15:50:19 -04:00
Orion Henry
17b0d2eb38 cleanup for clippy 2021-05-24 15:07:13 -04:00
Orion Henry
3465517ab3 handle conflicts in list parent modifications 2021-05-24 14:59:09 -04:00
Andrew Jeffery
c2f2ded69f Make encoding and decoding errors public 2021-05-21 14:00:17 +01:00
Andrew Jeffery
d5dfefb704
Fix backend panics (#141)
* Fix a panic when indexing the bytes

* Fix leb failing to read enough bytes

* Fix another panic out of bounds

* Use get rather than checking

* Check addition with arbitrary val

* Add backend load fuzzing

* Handle no ops sub

* Fix another index out of bounds
2021-05-20 11:24:23 +01:00
Andrew Jeffery
46ff9eabee Apply clippy suggestion 2021-05-19 22:10:09 +01:00
Andrew Jeffery
37717f2798 Cargo fmt 2021-05-19 19:10:47 +01:00
Alex Good
87410e4c8f Add comment explaining why it doesn't work 2021-05-17 19:53:36 +01:00
Alex Good
9bbaf7cbd5 Merge branch 'main' into implement-new-sequence-patch-format 2021-05-17 13:03:57 +01:00
Andrew Jeffery
426ccbc818
Expose event handler id (#132) 2021-05-16 20:16:54 +01:00
Andrew Jeffery
5637956895 Add custom RootDiff type
This ensures that the patch starts with the right diff type statically
and will give an error to js during deserialization.
2021-05-16 14:02:57 +01:00
Andrew Jeffery
30a89cb49d Fix clippy lints 2021-05-16 13:10:28 +01:00
Andrew Jeffery
2e07e93e72 Change patches diffs to be non-optional 2021-05-16 13:01:37 +01:00
Andrew Jeffery
f2025028cf Fix elem_id in get_patch test 2021-05-15 19:38:11 +01:00
Andrew Jeffery
553bf1f8ef Handle overwriting inserts with updates from the same actor 2021-05-15 19:14:16 +01:00
Andrew Jeffery
96eef611d0 Default head to index 0 2021-05-15 18:05:25 +01:00
Andrew Jeffery
7c4858e686 Fix obtaining index for set operation 2021-05-15 18:01:03 +01:00
Alex Good
6eb96f2816 Split patch generation out of OpSet 2021-05-14 21:56:24 +01:00