restic/internal/repository
Michael Eischer c147422ba5 repository: special case SaveBlob for all zero chunks
Sparse files contain large regions containing only zero bytes. Checking
that a blob only contains zeros is possible with over 100GB/s for modern
x86 CPUs. Calculating sha256 hashes is only possible with 500MB/s (or
2GB/s using hardware acceleration). Thus we can speed up the hash
calculation for all zero blobs (which always have length
chunker.MinSize) by checking for zero bytes and then using the
precomputed hash.

The all zeros check is only performed for blobs with the minimal chunk
size, and thus should add no overhead most of the time. For chunks which
are not all zero but have the minimal chunks size, the overhead will be
below 2% based on the above performance numbers.

This allows reading sparse sections of files as fast as the kernel can
return data to us. On my system using BTRFS this resulted in about
4GB/s.
2022-09-24 21:39:39 +02:00
..
testdata internal/repository: Fix LoadBlob + fuzz test 2022-06-06 17:02:28 +02:00
doc.go gofmt all files 2022-08-19 19:12:26 +02:00
fuzz_test.go repository: Rework blob saving to use an async pack uploader 2022-07-02 22:42:34 +02:00
index.go Merge pull request #3879 from MichaelEischer/mem-optimize 2022-08-26 20:33:02 +02:00
index_parallel.go repository: Reduce buffer reallocations in ForAllIndexes 2022-08-19 21:13:40 +02:00
index_parallel_test.go repository: Add test for ForAllIndexes 2020-12-22 22:36:18 +01:00
index_test.go repository: Do not report ignored packs in EachByPack 2022-08-21 10:38:40 +02:00
indexmap.go repository: Re-tune indexmap allocation strategy 2022-05-11 21:22:14 +02:00
indexmap_test.go repository: implement pack compression 2022-04-30 11:34:10 +02:00
key.go crypto: move crypto buffer helpers 2022-07-17 13:42:23 +02:00
master_index.go repository: MasterIndex.Packs: reduce allocations 2022-08-19 21:10:43 +02:00
master_index_test.go crypto: move crypto buffer helpers 2022-07-17 13:42:23 +02:00
packer_manager.go repository: prevent header overfill 2022-08-05 23:47:12 +02:00
packer_manager_test.go add option for setting min pack size 2022-08-05 23:47:12 +02:00
packer_uploader.go repository: Rework blob saving to use an async pack uploader 2022-07-02 22:42:34 +02:00
repack.go repository: cleanup copy connection count check 2022-08-28 11:40:56 +02:00
repack_test.go repository: don't hang when copying using a single connection 2022-08-28 11:40:31 +02:00
repository.go repository: special case SaveBlob for all zero chunks 2022-09-24 21:39:39 +02:00
repository_internal_test.go Use "pack file" instead of "data file" (#2885) 2020-08-16 11:16:38 +02:00
repository_test.go repository: StreamPack in parts if there are too large gaps 2022-08-05 23:48:36 +02:00
testing.go add option for setting min pack size 2022-08-05 23:47:12 +02:00