Posted on :: Tags: , , , , , ,

๐Ÿข We have an error in the publish action. Letโ€™s fix it and rerun it.

๐Ÿ‡ There are two errors. One resulted from forgetting sudo when installing dependencies. The other was the incorrect name for the OpenSSL library. It should be libssl-dev instead of openssl-dev. Maybe we can link the command list in the docs.

๐Ÿข Oops, yes, we should at least keep that in mind.

๐Ÿ‡ Iโ€™m checking the most popular crates. getrandom retrieves a random number from the system. It looks much lighter than the rand crate.

๐ŸฆŠ We can use once_cell to initialize XvcEntityCounter. We currently use Once for this purpose.

๐Ÿ‡ I donโ€™t think it will provide any better features.

๐ŸฆŠ For that case, yes, no better features. But the interface is something like:

impl<T> OnceCell<T> {
    const fn new() -> OnceCell<T> { ... }
    fn set(&self, value: T) -> Result<(), T> { ... }
    fn get(&self) -> Option<&T> { ... }
}

And this makes, for example, working with XvcRoot much easier. We are passing Arc<RwLock<XvcRootInner>>> everywhere. This is a heavy price when we only use it in a read-only manner. We can prevent most of these, when we use a read lock, by using OnceCell.

๐Ÿ‡ XvcConfig can benefit from this as well. We donโ€™t update the config during runs.

๐Ÿข Why do we want to assign it, though? We currently have a config field in XvcRootInner, and we get a reference to it with the config() method.

๐Ÿ‡ Ok. Letโ€™s skip this for now. No need to worry before measuring the performance impact.