Commit graph

694 commits

Author SHA1 Message Date
Vedant Roy
b36ee54dda Update C bindings to return pointers 2021-06-21 11:08:34 -04:00
Andrew Jeffery
885a763766
Calculate pred_for_key before deleting the key (#183) 2021-06-20 12:46:50 +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
98dbd6150e
Mutation tracker rollback (#165)
* Make set and delete operations return the old value

* Add rollback to MutableDocument

* Use rollback in optimistically_apply_change
2021-06-16 14:16:48 +01:00
Andrew Jeffery
0f0e9e827a
New value zero copy multivalue (#170)
* Remove copying when making a multivalue from a newvalue

* Optimise cursors in new value

* Make key be a value not reference

* Rename union to extend
2021-06-16 12:16:31 +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
4821cdd766
Calculate pred for deletion from text before deleting (#174) 2021-06-16 11:49:58 +01:00
dependabot[bot]
599c619a4d
Bump glob-parent from 5.1.1 to 5.1.2 in /automerge-backend-wasm (#166)
Bumps [glob-parent](https://github.com/gulpjs/glob-parent) from 5.1.1 to 5.1.2.
- [Release notes](https://github.com/gulpjs/glob-parent/releases)
- [Changelog](https://github.com/gulpjs/glob-parent/blob/main/CHANGELOG.md)
- [Commits](https://github.com/gulpjs/glob-parent/compare/v5.1.1...v5.1.2)

---
updated-dependencies:
- dependency-name: glob-parent
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-16 09:59:04 +01:00
Andrew Jeffery
f224940fdc
Fix Frontend debug struct name (#172) 2021-06-16 09:22:06 +01:00
Andrew Jeffery
71b59dea68
Set levels for instrument (#164) 2021-06-14 23:34:35 +01:00
Andrew Jeffery
14af0738dd
Remove MapType from Map and add Table variant (#168)
This simplifies the Value enum and hides the protocol internals from the
variants.
2021-06-14 21:26:02 +01:00
Andrew Jeffery
a6e955abfd
Rework statetree to be a tree (#156) 2021-06-14 11:08:14 +01:00
Orion Henry
ad3c75ff09 Remove unneeded wasm-opt 2021-06-12 15:01:38 -07:00
Orion Henry
647b8d2af2 fix deflate column decode order 2021-06-12 15:01:38 -07:00
Andrew Jeffery
a744637787
Add get_value to Value (#160) 2021-06-10 14:13:50 +01:00
Andrew Jeffery
098074dd1e
Add AsRef for Value (#162) 2021-06-09 16:51:56 +01:00
Andrew Jeffery
b8d282db61
Add more derived traits for Path (#163) 2021-06-09 11:06:54 +01:00
Andrew Jeffery
28459f868f
Remove value_at_path (#159)
This has the same functionality as get_value and we only need one.
2021-06-07 10:18:00 +01:00
Vedant Roy
1e9785cdc0 Everything uses MessagePack 2021-06-03 22:13:40 -07:00
Orion Henry
965a1c17b1 clippy 2021-06-03 22:13:40 -07:00
Vedant Roy
b4bc3f3ed9 Remove debug function 2021-06-03 22:13:40 -07:00
Vedant Roy
e035fb0b16 Use msgpack instead of JSON 2021-06-03 22:13:40 -07:00
Orion Henry
25a10a64d4 clippy 2021-05-29 17:11:17 -04:00
Orion Henry
d8a56d966e added binary search to doc decode for big speedup 2021-05-29 13:34:03 -07:00
Vedant Roy
ad604cc308 Satisfy clippy 2021-05-28 11:26:08 -07:00
Vedant Roy
5ace7d1cc0 Finish porting C tests 2021-05-28 11:26:08 -07:00
Vedant Roy
7fbf26bdec New backend finished (untested) 2021-05-28 11:26:08 -07:00
Vedant Roy
7469fe7f88 Everything done except syncstate 2021-05-28 11:26:08 -07:00
Vedant Roy
08209a4fd8 Switch to new json macro 2021-05-28 11:26:08 -07:00
Vedant Roy
5a3b767b7b Continue implementing infra 2021-05-28 11:26:08 -07:00
Vedant Roy
8b74a99b50 Implement basic infra for new C api 2021-05-28 11:26:08 -07:00
Vedant Roy
ef3289da14
Merge pull request #154 from automerge/msgpack-serde
Serialize/Deserialize OpType so it works with msgpack
2021-05-27 17:18:00 -07:00
Vedant Roy
ae3c3cd563 Avoid return 2021-05-27 17:17:16 -07:00
Vedant Roy
5f7628143d Use return... a bit less 2021-05-27 16:58:16 -07:00
Vedant Roy
f2c0a4953e Report incorrect variant error to serde in RawDiffType::deserialize 2021-05-27 16:54:34 -07:00
Alex Good
623d09d19f Report incorrect variant error to serde in RawOpType::deserialize 2021-05-28 00:40:09 +01:00
Vedant Roy
32f0821e0e Make another enum work with msgpack 2021-05-27 16:33:49 -07:00
Vedant Roy
c845351224 Serialize/Deserialize OpType so it works with msgpack 2021-05-27 15:54:07 -07:00
Andrew Jeffery
edf9edd35e
Simplify apply root diff (#150) 2021-05-26 11:45:30 +01:00
Andrew Jeffery
51f50b8f5c
diffable seq: Avoid rebuilding the updating list each time (#149)
This means we can keep things in the original state but while applying
the diff we don't have to keep building a new vec each time.

This makes B1.1 run in ~11 seconds for me.
2021-05-26 09:17:08 +01:00
Andrew Jeffery
fc50871b8e
Merge pull request #148 from automerge/diffable-sequence-remove-unused
Remove unused variables in diffable sequence
2021-05-25 23:25:09 +01:00
Andrew Jeffery
949d7b9f62 Remove unused variables
These were likely used at one point but now just incur an expensive
allocation cost. This reduces the B1.1 Append N characters benchmark
from ~19s to ~16s.
2021-05-25 22:45:36 +01:00
Andrew Jeffery
ac080c7b74
Merge pull request #147 from automerge/sort-pred
Sort predecessors during encoding
2021-05-25 11:40:18 +01: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
Andrew Jeffery
8876667a55 Set console_error_panic_hook when initing a backend 2021-05-24 13:19:39 -07:00