···18181919- drop sqlite, pick up fjall v3 for some speeeeeeed (and code simplification and easier build requirements and)
2020- no more `Processable` trait, process functions are just `Vec<u8> -> Vec<u8>` now (bring your own ser/de). there's a potential small cost here where processors need to now actually go through serialization even for in-memory car walking, but i think zero-copy approaches (eg. rkyv) are low-cost enough
2121-- custom deserialize for MST nodes that does as much depth calculation and rkey validation as - possible in-line. (not clear if it actually made anything faster)
2121+- custom deserialize for MST nodes that does as much depth calculation and key validation as possible in-line. (not clear if it actually made anything faster)
2222- check MST depth at every node properly (previously it could do some walking before being able to check and included some assumptions)
2323- check MST for empty leaf nodes (which not allowed)
2424- shave 0.6 nanoseconds (really) from MST depth calculation (don't ask)
+1-1
examples/disk-read-file/main.rs
···6464 log::info!("walking...");
65656666 // this example uses the disk driver's channel mode: the tree walking is
6767- // spawned onto a blocking thread, and we get chunks of rkey+blocks back
6767+ // spawned onto a blocking thread, and we get chunks of key + record pairs back
6868 let (mut rx, join) = driver.to_channel(512);
6969 while let Some(outputs) = rx.recv().await {
7070 let outputs = outputs?;
+1-1
readme.md
···6464more recent todo
6565- [ ] add a zero-copy rkyv process function example
6666- [ ] car slices
6767-- [ ] lazy-value stream (for rkey -> CID diffing; tap-like `#sync` handling; save a fjall record `.get` when not needed)
6767+- [ ] lazy-value stream (for key -> CID diffing; tap-like `#sync` handling; save a fjall record `.get` when not needed)
6868- [x] get an *emtpy* car for the test suite
6969- [x] implement a max size on disk limit
7070
+10-10
src/mst.rs
···137137 let mut prefix: Vec<u8> = vec![];
138138139139 for entry in map.next_value::<Vec<Entry>>()? {
140140- let mut rkey: Vec<u8> = vec![];
140140+ let mut key_bytes: Vec<u8> = vec![];
141141 let pre_checked =
142142 prefix.get(..entry.prefix_len).ok_or_else(|| {
143143 de::Error::invalid_value(
···146146 )
147147 })?;
148148149149- rkey.extend_from_slice(pre_checked);
150150- rkey.extend_from_slice(&entry.keysuffix);
149149+ key_bytes.extend_from_slice(pre_checked);
150150+ key_bytes.extend_from_slice(&entry.keysuffix);
151151152152- let rkey_s = String::from_utf8(rkey.clone()).map_err(|_| {
152152+ let key = String::from_utf8(key_bytes.clone()).map_err(|_| {
153153 de::Error::invalid_value(
154154- Unexpected::Bytes(&rkey),
155155- &"a valid utf-8 rkey",
154154+ Unexpected::Bytes(&key_bytes),
155155+ &"a valid utf-8 key",
156156 )
157157 })?;
158158159159- let key_layer = atproto_mst_layer(&rkey_s);
159159+ let key_layer = atproto_mst_layer(&key);
160160 if layer.is_none() {
161161 layer = Some(key_layer);
162162 } else if Some(key_layer) != layer {
163163 return Err(de::Error::invalid_value(
164164 Unexpected::Bytes(&prefix),
165165- &"all rkeys to have equal MST layer",
165165+ &"all keys to have equal MST layer",
166166 ));
167167 }
168168169169 things.push(NodeThing {
170170 link: entry.value.into(),
171171- kind: ThingKind::Record(rkey_s),
171171+ kind: ThingKind::Record(key),
172172 });
173173174174 if let Some(link) = entry.tree {
···178178 });
179179 }
180180181181- prefix = rkey;
181181+ prefix = key_bytes;
182182 }
183183 }
184184 f => return Err(de::Error::unknown_field(f, NODE_FIELDS)),