Commit Graph

11 Commits

Author SHA1 Message Date
Thomas Waldmann 3a38457def Merge branch 'merge-all' of ../attic into experimental 2015-06-05 22:58:08 +02:00
Thomas Waldmann 646cdca312 "extract" micro optimization: first check for regular files, then for directories, check for fifos late
regular files are most common, more than directories. fifos are rare.

was no big issue, the calls are cheap, but also no big issue to just fix the order.
2015-05-31 21:55:15 +02:00
Thomas Waldmann ed1e5e9c13 "create" micro optimization: do not check for sockets early
they are rare, so it's pointless to check for them first.

seen the stat..S_ISSOCK in profiling results with high call count.
was no big issue, that call is cheap, but also no big issue to just fix the order.
2015-05-31 21:54:51 +02:00
Thomas Waldmann a3f4d19515 speed up chunks cache sync, fixes #18
Re-synchronize chunks cache with repository.

If present, uses a compressed tar archive of known backup archive
indices, so it only needs to fetch infos from repo and build a chunk
index once per backup archive.

If out of sync, the tar gets rebuilt from known + fetched chunk infos,
so it has complete and current information about all backup archives.

Finally, it builds the master chunks index by merging all indices from
the tar.

Note: compression (esp. xz) is very effective in keeping the tar
            relatively small compared to the files it contains.

Use python >= 3.3 to get better compression with xz,
there's a fallback to bz2 or gz when xz is not supported.
2015-05-31 19:17:01 +02:00
Thomas Waldmann 072326fef0 chunker: get rid of read_buf
if we have a OS file handle, we can directly read to the final destination - one memcpy less.
if we have a Python file object, we get a Python bytes object as read result (can't save the memcpy here).
2015-05-31 18:41:23 +02:00
Thomas Waldmann 926454c0d8 explicitely specify binary mode to open binary files
on POSIX OSes, it doesn't make a difference, but it is cleaner and also good for portability.
2015-05-31 17:57:45 +02:00
Thomas Waldmann 776bb9fabc hashindex: improve error messages 2015-05-31 17:48:19 +02:00
Thomas Waldmann 91e10fec5f Merge branch 'master' of github.com:jborg/attic 2015-05-31 17:37:02 +02:00
Thomas Waldmann d067bc3178 efficient archive list from manifest
a lot of speedup for:
"list <repo>", "delete <repo>" list, "prune" - esp. for slow connections to remote repositories.

the previous method used metadata from the archive itself, which is (in total) rather large.
so if you had many archives and a slow (remote) connection, it was very slow.

but there is a lot easier way: just use the archives list from the repository manifest - we already
have it anyway and it also has name, id and timestamp for all archives - and that's all we need.

I defined a ArchiveInfo namedtuple that has same element names as seen as attribute names
of the Archive object, so as long as name, id, ts is enough, it can be used in its place.
2015-05-26 02:04:41 +02:00
Thomas Waldmann 5e98400a5a fix all references to package name
use relative imports if possible
reorder imports (1. stdlib 2. dependencies 3. borg 4. borg.testsuite)
2015-05-22 19:21:41 +02:00
Thomas Waldmann 78bfc58b47 rename package directory to borg 2015-05-22 17:48:54 +02:00