mirror of
https://github.com/loro-dev/loro.git
synced 2025-02-05 20:17:13 +00:00
chore: use columnar 0.3.2
This commit is contained in:
parent
0b64a567ed
commit
f1adc7d15d
13 changed files with 47 additions and 48 deletions
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
|
@ -6,6 +6,7 @@
|
|||
"flate",
|
||||
"gmax",
|
||||
"heapless",
|
||||
"insta",
|
||||
"Leeeon",
|
||||
"LOGSTORE",
|
||||
"napi",
|
||||
|
|
56
Cargo.lock
generated
56
Cargo.lock
generated
|
@ -1061,7 +1061,7 @@ dependencies = [
|
|||
"generic-btree",
|
||||
"getrandom",
|
||||
"im",
|
||||
"itertools 0.10.5",
|
||||
"itertools 0.11.0",
|
||||
"js-sys",
|
||||
"jumprope",
|
||||
"loro-common",
|
||||
|
@ -1075,7 +1075,7 @@ dependencies = [
|
|||
"rle",
|
||||
"serde",
|
||||
"serde-wasm-bindgen",
|
||||
"serde_columnar 0.3.1",
|
||||
"serde_columnar 0.3.2",
|
||||
"serde_json",
|
||||
"smallvec",
|
||||
"static_assertions",
|
||||
|
@ -1892,13 +1892,15 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "serde_columnar"
|
||||
version = "0.3.1"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "98e0e9eb205e8f31604c26118d3f3626b21e3170a243ddfe1b7131b79725b114"
|
||||
dependencies = [
|
||||
"flate2",
|
||||
"itertools 0.11.0",
|
||||
"postcard",
|
||||
"serde",
|
||||
"serde_columnar_derive 0.3.1",
|
||||
"serde_columnar_derive 0.3.2",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
|
@ -1916,7 +1918,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "serde_columnar_derive"
|
||||
version = "0.3.1"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "46d50a130ce1b4cf3b1585342ee0bf71e7589845ec23283e85fc875606018520"
|
||||
dependencies = [
|
||||
"darling 0.20.3",
|
||||
"proc-macro2 1.0.64",
|
||||
|
@ -2433,13 +2437,13 @@ version = "0.42.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
|
||||
dependencies = [
|
||||
"windows_aarch64_gnullvm 0.42.1",
|
||||
"windows_aarch64_msvc 0.42.1",
|
||||
"windows_i686_gnu 0.42.1",
|
||||
"windows_i686_msvc 0.42.1",
|
||||
"windows_x86_64_gnu 0.42.1",
|
||||
"windows_x86_64_gnullvm 0.42.1",
|
||||
"windows_x86_64_msvc 0.42.1",
|
||||
"windows_aarch64_gnullvm 0.42.2",
|
||||
"windows_aarch64_msvc 0.42.2",
|
||||
"windows_i686_gnu 0.42.2",
|
||||
"windows_i686_msvc 0.42.2",
|
||||
"windows_x86_64_gnu 0.42.2",
|
||||
"windows_x86_64_gnullvm 0.42.2",
|
||||
"windows_x86_64_msvc 0.42.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2468,9 +2472,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "windows_aarch64_gnullvm"
|
||||
version = "0.42.1"
|
||||
version = "0.42.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608"
|
||||
checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_gnullvm"
|
||||
|
@ -2480,9 +2484,9 @@ checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc"
|
|||
|
||||
[[package]]
|
||||
name = "windows_aarch64_msvc"
|
||||
version = "0.42.1"
|
||||
version = "0.42.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7"
|
||||
checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_msvc"
|
||||
|
@ -2492,9 +2496,9 @@ checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3"
|
|||
|
||||
[[package]]
|
||||
name = "windows_i686_gnu"
|
||||
version = "0.42.1"
|
||||
version = "0.42.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640"
|
||||
checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnu"
|
||||
|
@ -2504,9 +2508,9 @@ checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241"
|
|||
|
||||
[[package]]
|
||||
name = "windows_i686_msvc"
|
||||
version = "0.42.1"
|
||||
version = "0.42.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605"
|
||||
checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_msvc"
|
||||
|
@ -2516,9 +2520,9 @@ checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00"
|
|||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnu"
|
||||
version = "0.42.1"
|
||||
version = "0.42.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45"
|
||||
checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnu"
|
||||
|
@ -2528,9 +2532,9 @@ checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1"
|
|||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnullvm"
|
||||
version = "0.42.1"
|
||||
version = "0.42.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463"
|
||||
checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnullvm"
|
||||
|
@ -2540,9 +2544,9 @@ checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953"
|
|||
|
||||
[[package]]
|
||||
name = "windows_x86_64_msvc"
|
||||
version = "0.42.1"
|
||||
version = "0.42.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd"
|
||||
checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_msvc"
|
||||
|
|
|
@ -27,10 +27,10 @@ js-sys = { version = "0.3.60", optional = true }
|
|||
serde_json = { version = "1.0.87", optional = true }
|
||||
arref = "0.1.0"
|
||||
debug-log = { version = "0.1.4", features = [] }
|
||||
serde_columnar = { path = "../../../columnar/columnar" }
|
||||
serde_columnar = { version = "0.3.2" }
|
||||
tracing = { version = "0.1.37" }
|
||||
append-only-bytes = { version = "0.1.8", features = ["u32_range"] }
|
||||
itertools = "0.10.5"
|
||||
itertools = "0.11.0"
|
||||
enum_dispatch = "0.3.11"
|
||||
im = "15.1.0"
|
||||
jumprope = { version = "1.1.2", features = ["wchar_conversion"] }
|
||||
|
@ -54,7 +54,6 @@ flate2 = "1.0.24"
|
|||
arbtest = "0.2.0"
|
||||
bench-utils = { path = "../bench-utils" }
|
||||
|
||||
|
||||
# See https://matklad.github.io/2021/02/27/delete-cargo-integration-tests.html
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -338,7 +338,6 @@ mod compact_register {
|
|||
|
||||
impl CompactRegister {
|
||||
pub fn push(&mut self, value: CompactMapValue) {
|
||||
println!("btree len {}", self.tree.len());
|
||||
self.tree.insert(value);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ use std::{collections::VecDeque, ops::Range, sync::Arc};
|
|||
use fxhash::FxHashMap;
|
||||
use itertools::Itertools;
|
||||
use rle::{HasLength, RleVec};
|
||||
use serde_columnar::{columnar, iter_from_bytes, iterable::*, to_vec};
|
||||
use serde_columnar::{columnar, iter_from_bytes, to_vec};
|
||||
|
||||
use crate::{
|
||||
change::{Change, Lamport, Timestamp},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use fxhash::{FxHashMap, FxHashSet};
|
||||
use loro_common::{HasCounterSpan, HasLamportSpan};
|
||||
use rle::{HasLength, RleVec};
|
||||
use serde_columnar::{columnar, iter_from_bytes, iterable::*, to_vec};
|
||||
use serde_columnar::{columnar, iter_from_bytes, to_vec};
|
||||
use std::{borrow::Cow, cmp::Ordering, ops::Deref, sync::Arc};
|
||||
use zerovec::{vecs::Index32, VarZeroVec};
|
||||
|
||||
|
@ -110,9 +110,8 @@ struct DocEncoding<'a> {
|
|||
normal_containers: Vec<NormalContainer>,
|
||||
#[columnar(borrow)]
|
||||
str: Cow<'a, str>,
|
||||
// #[columnar(borrow)]
|
||||
#[columnar(borrow)]
|
||||
root_containers: VarZeroVec<'a, RootContainerULE, Index32>,
|
||||
|
||||
start_counter: Vec<Counter>,
|
||||
values: Vec<LoroValue>,
|
||||
clients: Vec<PeerID>,
|
||||
|
@ -379,8 +378,8 @@ pub fn decode_oplog_v2(oplog: &mut OpLog, input: &[u8]) -> Result<(), LoroError>
|
|||
));
|
||||
}
|
||||
|
||||
let mut op_iter = ops.into_iter();
|
||||
let mut deps_iter = deps.into_iter();
|
||||
let mut op_iter = ops;
|
||||
let mut deps_iter = deps;
|
||||
let get_container = |idx: usize| {
|
||||
if idx < root_containers.len() {
|
||||
let Some(container) = root_containers.get(idx) else {
|
||||
|
@ -405,7 +404,6 @@ pub fn decode_oplog_v2(oplog: &mut OpLog, input: &[u8]) -> Result<(), LoroError>
|
|||
let mut value_iter = values.into_iter();
|
||||
let mut str_index = 0;
|
||||
let changes = change_encodings
|
||||
.into_iter()
|
||||
.map(|change_encoding| {
|
||||
let counter = start_counter
|
||||
.get_mut(change_encoding.peer_idx as usize)
|
||||
|
|
|
@ -6,13 +6,13 @@ use std::cmp::Ordering;
|
|||
use std::rc::Rc;
|
||||
|
||||
use fxhash::FxHashMap;
|
||||
use loro_common::{HasCounter, HasId};
|
||||
use loro_common::HasId;
|
||||
use rle::{HasLength, RleVec};
|
||||
// use tabled::measurment::Percent;
|
||||
|
||||
use crate::change::{Change, Lamport, Timestamp};
|
||||
use crate::container::list::list_op;
|
||||
use crate::dag::{Dag, DagUtils};
|
||||
use crate::dag::DagUtils;
|
||||
use crate::encoding::{decode_oplog, encode_oplog, EncodeMode};
|
||||
use crate::encoding::{ClientChanges, RemoteClientChanges};
|
||||
use crate::id::{Counter, PeerID, ID};
|
||||
|
|
|
@ -7,7 +7,7 @@ use loro_preload::{
|
|||
CommonArena, EncodedAppState, EncodedContainerState, FinalPhase, MapEntry, TempArena,
|
||||
};
|
||||
use rle::{HasLength, RleVec};
|
||||
use serde_columnar::{columnar, iterable::*, to_vec};
|
||||
use serde_columnar::{columnar, to_vec};
|
||||
use smallvec::smallvec;
|
||||
|
||||
use crate::{
|
||||
|
@ -279,11 +279,6 @@ struct OplogEncoded {
|
|||
}
|
||||
|
||||
impl OplogEncoded {
|
||||
fn decode(data: &FinalPhase) -> Result<Self, LoroError> {
|
||||
serde_columnar::from_bytes(&data.oplog)
|
||||
.map_err(|e| LoroError::DecodeError(e.to_string().into_boxed_str()))
|
||||
}
|
||||
|
||||
fn decode_iter<'f: 'iter, 'iter>(
|
||||
data: &'f FinalPhase,
|
||||
) -> Result<<Self as TableIter<'iter>>::Iter, LoroError> {
|
||||
|
|
BIN
crates/loro-internal/tests/history_compressed_rle_updates.dat
Normal file
BIN
crates/loro-internal/tests/history_compressed_rle_updates.dat
Normal file
Binary file not shown.
Binary file not shown.
BIN
crates/loro-internal/tests/history_snapshot.dat
Normal file
BIN
crates/loro-internal/tests/history_snapshot.dat
Normal file
Binary file not shown.
|
@ -22,7 +22,11 @@ fn import() {
|
|||
#[test]
|
||||
fn import_history() {
|
||||
let doc = LoroDoc::new();
|
||||
doc.import(include_bytes!("./history_data_v1.dat")).unwrap();
|
||||
doc.import(include_bytes!("./history_compressed_rle_updates.dat"))
|
||||
.unwrap();
|
||||
let doc2 = LoroDoc::new();
|
||||
doc2.import(include_bytes!("./history_snapshot.dat"))
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use bytes::{BufMut, BytesMut};
|
||||
use loro_common::{ContainerID, InternalString, LoroError, LoroValue, ID};
|
||||
use serde_columnar::{columnar, to_vec};
|
||||
use serde_columnar::to_vec;
|
||||
use std::borrow::Cow;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -84,7 +84,6 @@ impl<'a> FinalPhase<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
// #[columnar(ser, de)]
|
||||
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
|
||||
pub struct CommonArena<'a> {
|
||||
#[serde(borrow)]
|
||||
|
|
Loading…
Reference in a new issue