mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-04-30 10:48:24 +00:00
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:
parent
0e9aa78bf4
commit
c1689192d9
@ -415,7 +415,9 @@ impl BackupDir {
|
|||||||
|
|
||||||
/// Returns the absolute path for backup_dir, using the cached formatted time string.
|
/// Returns the absolute path for backup_dir, using the cached formatted time string.
|
||||||
pub fn full_path(&self) -> PathBuf {
|
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 {
|
pub fn protected_file(&self) -> PathBuf {
|
||||||
|
Loading…
Reference in New Issue
Block a user