syncthing/vendor/github.com
Jakob Borg 9682bbfbda lib/protocol: Optimize luhn and chunk functions
These functions were very naive and slow. We haven't done much about
them because they pretty much don't matter at all for Syncthing
performance. They are however called very often in the discovery server
and these optimizations have a huge effect on the CPU load on the
public discovery servers.

The code isn't exactly obvious, but we have good test coverage on all
these functions.

benchmark                 old ns/op     new ns/op     delta
BenchmarkLuhnify-8        12458         1045          -91.61%
BenchmarkUnluhnify-8      12598         1074          -91.47%
BenchmarkChunkify-8       10792         104           -99.04%

benchmark                 old allocs     new allocs     delta
BenchmarkLuhnify-8        18             1              -94.44%
BenchmarkUnluhnify-8      18             1              -94.44%
BenchmarkChunkify-8       44             2              -95.45%

benchmark                 old bytes     new bytes     delta
BenchmarkLuhnify-8        1278          64            -94.99%
BenchmarkUnluhnify-8      1278          64            -94.99%
BenchmarkChunkify-8       42552         128           -99.70%

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4346
2017-09-03 10:26:12 +00:00
..
AudriusButkevicius vendor: Update kcp, removes closeConn (fixes #4343) 2017-09-02 16:11:48 +02:00
bkaradzic/go-lz4 vendor: Mega update all dependencies 2017-04-05 14:34:41 +00:00
calmh lib/protocol: Optimize luhn and chunk functions 2017-09-03 10:26:12 +00:00
ccding/go-stun/stun vendor: Mega update all dependencies 2017-04-05 14:34:41 +00:00
chmduquesne/rollinghash vendor: Mega update all dependencies 2017-04-05 14:34:41 +00:00
cznic vendor: Mega update all dependencies 2017-04-05 14:34:41 +00:00
d4l3k/messagediff vendor: Mega update all dependencies 2017-04-05 14:34:41 +00:00
edsrzf/mmap-go vendor: Mega update all dependencies 2017-04-05 14:34:41 +00:00
gobwas/glob vendor: Mega update all dependencies 2017-04-05 14:34:41 +00:00
gogo/protobuf vendor: Update github.com/gogo/protobuf, keeping all files 2017-06-14 05:24:09 +02:00
golang vendor: Mega update all dependencies 2017-04-05 14:34:41 +00:00
jackpal/gateway vendor: Mega update all dependencies 2017-04-05 14:34:41 +00:00
kardianos/osext vendor: Mega update all dependencies 2017-04-05 14:34:41 +00:00
kballard/go-shellquote all: Convert folders to use filesystem abstraction 2017-08-19 14:36:56 +00:00
klauspost vendor: Mega update all dependencies 2017-04-05 14:34:41 +00:00
lib/pq vendor: Mega update all dependencies 2017-04-05 14:34:41 +00:00
minio/sha256-simd vendor: Mega update all dependencies 2017-04-05 14:34:41 +00:00
onsi vendor: Mega update all dependencies 2017-04-05 14:34:41 +00:00
oschwald vendor: Mega update all dependencies 2017-04-05 14:34:41 +00:00
petermattis/goid vendor: Mega update all dependencies 2017-04-05 14:34:41 +00:00
pkg/errors vendor: Mega update all dependencies 2017-04-05 14:34:41 +00:00
rcrowley/go-metrics vendor: Mega update all dependencies 2017-04-05 14:34:41 +00:00
remyoudompheng/bigfft vendor: Mega update all dependencies 2017-04-05 14:34:41 +00:00
sasha-s/go-deadlock vendor: Mega update all dependencies 2017-04-05 14:34:41 +00:00
stathat/go vendor: Mega update all dependencies 2017-04-05 14:34:41 +00:00
syndtr/goleveldb/leveldb vendor: Mega update all dependencies 2017-04-05 14:34:41 +00:00
templexxx/xor lib/connections: Use our own fork of kcp (fixes #4063) 2017-09-02 06:04:35 +00:00
thejerf/suture vendor: Mega update all dependencies 2017-04-05 14:34:41 +00:00
vitrun/qart vendor: Mega update all dependencies 2017-04-05 14:34:41 +00:00
xtaci/smux lib/connections: Use our own fork of kcp (fixes #4063) 2017-09-02 06:04:35 +00:00