cleanup_old_backups() loads all backups into memory #12
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
cleanup_old_backups() loads all backups into memory
Priority: Low
Component: backup.py
Type: Performance
Description
The cleanup function loads all backup entries into memory as a list, even when only iterating through them once. For backup directories with thousands of backups, this is inefficient.
Location
curateipsum/backup.py:179-180Current Code
Problem
sorted()requires materializing the entire iterable into memory. The backup entries themselves contain stat information that could be large.Proposed Solution
If the backup count is reasonable (<1000), current approach is fine. But could be optimized if needed:
Impact
Low - Only becomes a problem with thousands of backups, which is unlikely in normal use.