7 ms·
Well, it's hard to give a concise overview, but in short -- I use `wincode` for serde (without zero-copy deserialization though; I've tried zero-copy first with
by popzxc 25d ago
Well, it's hard to give a concise overview, but in short -- I use `wincode` for serde (without zero-copy deserialization though; I've tried zero-copy first with rkyv but it was not trivial at all so I abandoned this idea, plus FS does not dominate the costs so far anyway).
Data is written at the end of indexing phase, during write we hold a lock, and the codebase is aware that offloaded data can be corrupted/outdated (mostly relevant for cache).
Query processing works on top of transaction, and the transaction holds data loaded from files for the duration of the query, and frees once the query is dropped.
There is a ton of tricky parts there, but I guess that's the gist of it.
If you're interested, here are the relevant parts of the source code:
https://github.com/rust-glancer/rust-glancer/tree/main/crates/engine/package-store https://github.com/rust-glancer/rust-glancer/tree/main/crate...
https://github.com/rust-glancer/rust-glancer/tree/main/crates/engine/project/src/cache https://github.com/rust-glancer/rust-glancer/tree/main/crate...
https://github.com/rust-glancer/rust-glancer/blob/main/crates/engine/project/src/project/loading.rs https://github.com/rust-glancer/rust-glancer/blob/main/crate...
https://github.com/rust-glancer/rust-glancer/blob/main/crates/engine/project/src/project/txn.rs https://github.com/rust-glancer/rust-glancer/blob/main/crate...