Commit graph

828 commits

Author SHA1 Message Date
Orion Henry
d01e7ceb0e add webpack example and move into wasm folder 2022-05-15 11:53:55 -04:00
Orion Henry
aa5a03a0c4 webpack example config 2022-05-15 11:53:04 -04:00
Orion Henry
f6eca5eec6
Merge pull request #362 from jeffa5/range-rev
Add tests and fixes for double ended map range iterator
2022-05-12 09:02:05 -07:00
Orion Henry
b17c86e36e
Merge pull request #365 from automerge/opset-iter-nth
Implement OpTreeIter::nth correctly
2022-05-12 09:00:29 -07:00
Andrew Jeffery
f373deba6b Add length assertion 2022-05-11 21:15:50 +01:00
Andrew Jeffery
8f71ac30a4 Add index info to op_tree panic message 2022-05-11 20:26:39 +01:00
Alex Good
4e431c00a1
Implement OpTreeIter::nth correctly
The previous implementation of nth was incorrect, it returned the nth
element of the optree but it did not modify the internal state of the
iterator such that future calls to `next()` were after the nth element.
This commit fixes that.

Signed-off-by: Alex Good <alex@memoryandthought.me>
2022-05-09 23:11:18 +01:00
Alex Good
004d1a0cf2
Update CI toolchain to 1.60 2022-05-09 22:53:39 +01:00
Orion Henry
d6a6b34e99
Merge pull request #364 from jkankiewicz/improve_symmetry
C API symmetry improvements
2022-05-07 11:03:34 -04:00
Jason Kankiewicz
fdd3880bd3 Renamed AMalloc() to AMcreate().
Renamed `AMload()` to `AMloadIncremental()`.
Added the `AMload()` function.
2022-05-07 09:55:05 -05:00
Orion Henry
f0da2d2348
Merge pull request #361 from jkankiewicz/quickstart_error_reporting
Improve error reporting in C quickstart example.
2022-05-06 11:18:01 -04:00
Jason Kankiewicz
b56464c2e7 Switched to C comment delimiting. 2022-05-06 04:59:47 -05:00
Jason Kankiewicz
bb3d75604a Improved the documentation slightly. 2022-05-06 04:51:44 -05:00
Jason Kankiewicz
eb3155e49b Sorted main() to the top. Documented test(). 2022-05-06 04:50:02 -05:00
Andrew Jeffery
28a61f2dcd Add tests and fixes for double ended map range iterator 2022-05-06 09:49:00 +01:00
Jason Kankiewicz
944e5d8001 Trap and report all errors. 2022-05-05 21:21:46 -05:00
Andrew Jeffery
7d5eaa0b7f Move automerge unit tests to new file for clarity 2022-05-05 14:58:22 +01:00
Andrew Jeffery
5b15a04516 Some tidies 2022-05-05 14:52:01 +01:00
Orion Henry
dc441a1a61
Merge pull request #360 from jkankiewicz/add_quickstart
Add a port of Rust's quickstart to the C API
2022-05-04 10:28:14 -04:00
Orion Henry
3f746a0dc3
Merge pull request #358 from jeffa5/msrv
Use an MSRV in CI
2022-05-04 10:23:58 -04:00
Orion Henry
c43f672924
Merge pull request #356 from automerge/values_range_fix
fixed panic in doc.values() - fixed concurrency bugs in range
2022-05-04 10:22:46 -04:00
Orion Henry
fb8f3e5d4e fixme: performance 2022-05-04 10:09:50 -04:00
Orion Henry
54042bcf96 and unimplemented double ended iterator 2022-05-04 09:50:27 -04:00
Jason Kankiewicz
729752dac2 De-emphasized the AMload() call's result. 2022-05-04 08:27:15 -05:00
Jason Kankiewicz
3cf990eabf Fixed some minor inconsistencies in quickstart.c. 2022-05-04 07:45:05 -05:00
Jason Kankiewicz
069c33a13e Moved the AMbyteSpan struct into its own source
file.
Added the `AMchangeHashes` struct.
Added the `AMchange` and `AMchanges` structs.
Tied the lifetime of an `AMobjId` struct to the `AMresult` struct that
it's returned through so that it can be used to reach equivalent objects
within multiple `AMdoc` structs.
Removed the `AMfreeObjId()` function.
Renamed `AMallocDoc()` to `AMalloc()`.
Added the `AMcommit()` function.
Added the `AMgetChangeHash()` function.
Added the `AMgetChanges()` function.
Added the `AMgetMessage()` function.
Added the `AMlistDelete()` function.
Added the `AMlistPutBool()` function.
Added the `AMmapDelete()` function.
Added the `AMmapPutBool()` function.
Added the `AMobjSizeAt()` function.
Added the `AMsave()` function.
Renamed the `AMvalue::Nothing` variant to `AMvalue::Void`.
Changed all `AMobjId` struct function arguments to be immutable.
2022-05-04 01:04:43 -05:00
Jason Kankiewicz
58e0ce5efb Renamed the AMvalue::Nothing variant to AMvalue::Void.
Tied the lifetime of an `AMobjId` struct to the `AMresult` struct that
it's returned through so that it can be used to reach equivalent objects
within multiple `AMdoc` structs.
Added test cases for the `AMlistPutBool()` function.
Added a test case for the `AMmapPutBool()` function.
2022-05-04 01:04:43 -05:00
Jason Kankiewicz
c6e7f993fd Moved the AMbyteSpan struct into its own source
file.
Added the `AMchangeHashes` struct.
Added the `AMchange` and `AMchanges` structs.
Added `ChangeHashes` and `Changes` variants to the `AMresult` struct.
Renamed the `AMvalue::Nothing` variant to `AMvalue::Void`.
Tied the lifetime of an `AMobjId` struct to the `AMresult` struct that
it's returned through so that it can be used to reach equivalent objects
within multiple `AMdoc` structs.
Consolidated the `AMresult` struct's related trait implementations.
2022-05-04 01:04:43 -05:00
Jason Kankiewicz
30b220d9b7 Added a port of the Rust quickstart example. 2022-05-04 01:04:43 -05:00
Jason Kankiewicz
bf6ee85c58 Added the time_t header. 2022-05-04 01:04:43 -05:00
Orion Henry
a728b8216b range -> map_range(), added list_range() values() works on both 2022-05-03 19:27:51 -04:00
Andrew Jeffery
0aab13a990 Set rust-version in cargo.tomls 2022-05-02 21:18:00 +01:00
Andrew Jeffery
3ec1127b50 Try 1.57.0 as msrv 2022-05-02 21:18:00 +01:00
Orion Henry
291557a019
Merge pull request #350 from jeffa5/opt-prop
Optimise prop query
2022-05-02 14:15:53 -04:00
Orion Henry
cc4b8399b1
Merge pull request #357 from automerge/faster-opset-iterator
Make the OpSet iterator faster
2022-05-02 14:15:06 -04:00
Orion Henry
bcdc8a2752 fmt 2022-05-02 13:32:59 -04:00
Orion Henry
0d3eb07f3f fix key/elemid bug and rename range to map_range 2022-05-02 13:30:59 -04:00
Alex Good
7f4460f200
Make the OpSet iterator faster
The opset iterator was using `OpTreeInternal::get(index)` to fetch each
successive element of the OpSet. This is pretty slow. We make this much
faster by implementing an iterator which is aware of the internal
structure of the OpTree.

This speeds up the save benchmark by about 10%.

Signed-off-by: Alex Good <alex@memoryandthought.me>
2022-05-01 00:07:39 +01:00
Orion Henry
9e6044c128 fixed panic in doc.values() - fixed concurrency bugs in range 2022-04-29 15:11:07 -04:00
Andrew Jeffery
6bf03e006c Add ability to skip in tree searches 2022-04-28 14:14:03 +01:00
Andrew Jeffery
8baacb281b Add save and load map benchmarks 2022-04-28 14:14:03 +01:00
Andrew Jeffery
7de0cff2c9 Rework benchmarks to be in a group 2022-04-28 14:14:03 +01:00
Andrew Jeffery
c38b49609f Remove clone from update
The cloning of the op was eating up a significant part of the increment
operation's time. This makes it zero-clone and just extracts the fields
needed.
2022-04-28 14:14:03 +01:00
Andrew Jeffery
db280c3d1d prop: Skip over nodes 2022-04-28 14:14:03 +01:00
Andrew Jeffery
7dfe311aae Store keys as well as elemids in visible index 2022-04-28 14:14:03 +01:00
Andrew Jeffery
bb4727ac34 Skip empty nodes in prop query 2022-04-28 14:14:03 +01:00
Andrew Jeffery
bdacaa1703 Use treequery rather than repeated gets 2022-04-28 14:14:03 +01:00
Andrew Jeffery
a388ffbf19 Add some benches 2022-04-28 14:14:03 +01:00
Andrew Jeffery
ca8a2a0762 Add cmake deps to nix flake 2022-04-28 14:13:36 +01:00
Orion Henry
be33f91346 Merge branch 'experiment' 2022-04-27 11:58:53 -04:00