public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup] datastore: use cached snapshot time string in path
@ 2024-07-03 15:08 Gabriel Goller
  2024-07-12 12:01 ` [pbs-devel] applied: " Wolfgang Bumiller
  0 siblings, 1 reply; 2+ messages in thread
From: Gabriel Goller @ 2024-07-03 15:08 UTC (permalink / raw)
  To: pbs-devel

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>
---
 pbs-datastore/src/backup_info.rs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pbs-datastore/src/backup_info.rs b/pbs-datastore/src/backup_info.rs
index bdfaeabc1d12..414ec878d01a 100644
--- a/pbs-datastore/src/backup_info.rs
+++ b/pbs-datastore/src/backup_info.rs
@@ -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 {
-- 
2.43.0



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pbs-devel] applied: [PATCH proxmox-backup] datastore: use cached snapshot time string in path
  2024-07-03 15:08 [pbs-devel] [PATCH proxmox-backup] datastore: use cached snapshot time string in path Gabriel Goller
@ 2024-07-12 12:01 ` Wolfgang Bumiller
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Bumiller @ 2024-07-12 12:01 UTC (permalink / raw)
  To: Gabriel Goller; +Cc: pbs-devel

applied, thanks


_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-07-12 12:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-03 15:08 [pbs-devel] [PATCH proxmox-backup] datastore: use cached snapshot time string in path Gabriel Goller
2024-07-12 12:01 ` [pbs-devel] applied: " Wolfgang Bumiller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal