Posted on :: Tags: , , , ,

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

๐Ÿ‡ There are two errors. One is from forgetting sudo when installing dependencies. The other is the wrong name for 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 most popular crates. getrandom retrieves random number from the system. It looks much lighter than rand crate.

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

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

๐ŸฆŠ For that case, yes, not 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 read only. We can prevent most of these, when we use read lock, by using OnceCell.

๐Ÿ‡ XvcConfig can benefit from this as well. We donโ€™t update 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 config() method.

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