datastore: use cached snapshot time string in path

When getting the `full_path` of a snapshot we did not use the cached
time string. By using it we avoid a call to the super-slow libc strftime.

This has some minor performance improvements of circa 7%. That is ~100ms
on my datastore with ~5000 snapshots.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
This commit is contained in:
Gabriel Goller 2024-07-03 17:08:36 +02:00 committed by Wolfgang Bumiller
parent 0e9aa78bf4
commit c1689192d9

View File

@ -415,7 +415,9 @@ impl BackupDir {
/// Returns the absolute path for backup_dir, using the cached formatted time string.
pub fn full_path(&self) -> PathBuf {
self.store.snapshot_path(&self.ns, &self.dir)
let mut path = self.store.base_path();
path.push(self.relative_path());
path
}
pub fn protected_file(&self) -> PathBuf {