1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-25 09:18:55 +00:00
restic/internal/restorer
greatroar 5d4568d393 Write sparse files in restorer
This writes files by using (*os.File).Truncate, which resolves to the
truncate system call on Unix.

Compared to the naive loop,

	for _, b := range p {
		if b != 0 {
			return false
		}
	}

the optimized allZero is about 10× faster:

name       old time/op    new time/op     delta
AllZero-8    1.09ms ± 1%     0.09ms ± 1%    -92.10%  (p=0.000 n=10+10)

name       old speed      new speed       delta
AllZero-8  3.84GB/s ± 1%  48.59GB/s ± 1%  +1166.51%  (p=0.000 n=10+10)
2022-09-24 21:18:48 +02:00
..
doc.go gofmt all files 2022-08-19 19:12:26 +02:00
filerestorer.go adapt workers based on whether an operation is CPU or IO-bound 2022-07-03 12:19:26 +02:00
filerestorer_test.go crypto: move crypto buffer helpers 2022-07-17 13:42:23 +02:00
fileswriter.go Write sparse files in restorer 2022-09-24 21:18:48 +02:00
fileswriter_test.go Write sparse files in restorer 2022-09-24 21:18:48 +02:00
hardlinks_index.go restorer: extract hardlinks index from restic package 2022-07-17 13:45:42 +02:00
hardlinks_index_test.go restorer: extract hardlinks index from restic package 2022-07-17 13:45:42 +02:00
preallocate_darwin.go Use FcntlFstore to preallocate on Mac 2021-04-10 16:54:07 +02:00
preallocate_linux.go
preallocate_other.go add go:build headers everywhere 2022-03-28 22:23:47 +02:00
preallocate_test.go restorer: Skip preallocate test if not supported by the filesystem 2021-03-04 20:33:46 +01:00
restorer.go Merge pull request #3830 from MichaelEischer/cleanup-repo 2022-07-23 10:46:13 +02:00
restorer_test.go repository: extract Load/StoreJSONUnpacked 2022-07-17 13:22:00 +02:00
restorer_unix_test.go Write sparse files in restorer 2022-09-24 21:18:48 +02:00
sparsewrite.go Write sparse files in restorer 2022-09-24 21:18:48 +02:00