syncthing/lib/scanner
Jakob Borg dc32f7f0a3 Reduce allocations in HashFile
By using copyBuffer we avoid a buffer allocation for each block we hash,
and by allocating space for the hashes up front we get one large backing
array instead of a small one for each block. For a 17 MiB file this
makes quite a difference in the amount of memory allocated:

	benchmark               old ns/op     new ns/op     delta
	BenchmarkHashFile-8     102045110     100459158     -1.55%

	benchmark               old allocs     new allocs     delta
	BenchmarkHashFile-8     415            144            -65.30%

	benchmark               old bytes     new bytes     delta
	BenchmarkHashFile-8     4504296       48104         -98.93%
2015-10-27 09:37:27 +01:00
..
testdata mv internal lib 2015-08-09 09:35:26 +02:00
.gitignore Add benchmark of HashFile 2015-10-27 09:30:34 +01:00
blockqueue.go Implement facility based logger, debugging via REST API 2015-10-03 18:09:53 +02:00
blocks.go Reduce allocations in HashFile 2015-10-27 09:37:27 +01:00
blocks_test.go Fix import paths 2015-09-22 19:38:46 +02:00
debug.go Implement facility based logger, debugging via REST API 2015-10-03 18:09:53 +02:00
doc.go mv internal lib 2015-08-09 09:35:26 +02:00
walk.go Fix division by zero (fixes #2373) 2015-10-12 18:57:15 +01:00
walk_test.go Add benchmark of HashFile 2015-10-27 09:30:34 +01:00