syncthing/lib/scanner
Jakob Borg 9b1c592fb7 lib/scanner: Speed up weak hash
The rolling version of adler32 is just a wrapper around the standard
hash/adler32 when used in a non-rolling fashion, but it's inefficient as
it allocates a new hash instance for every Write(). This uses the
default version instead in the block hasher, and adds a test to verify
the result is the same as they were before. It reduces allocations by
88% and increases speed about 5%.

	benchmark               old ns/op     new ns/op     delta
	BenchmarkHashFile-8     64434698      61303647      -4.86%

	benchmark               old MB/s     new MB/s     speedup
	BenchmarkHashFile-8     276.65       290.78       1.05x

	benchmark               old allocs     new allocs     delta
	BenchmarkHashFile-8     1238           150            -87.88%

	benchmark               old bytes     new bytes     delta
	BenchmarkHashFile-8     17877363      49292         -99.72%
2017-01-18 10:33:17 +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 lib/scanner: Recheck file size and modification time after hashing (ref #3440) 2016-07-26 08:51:39 +00:00
blocks_test.go lib/scanner: Speed up weak hash 2017-01-18 10:33:17 +01:00
blocks.go lib/scanner: Speed up weak hash 2017-01-18 10:33:17 +01: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_test.go lib/scanner: Speed up weak hash 2017-01-18 10:33:17 +01:00
walk.go lib/ignore: Centralize handling of temporary filenames (fixes #3899) 2017-01-17 07:33:48 +00:00