mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 14:50:56 +00:00
dc32f7f0a3
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% |
||
---|---|---|
.. | ||
auto | ||
beacon | ||
config | ||
connections | ||
db | ||
dialer | ||
discover | ||
events | ||
fnmatch | ||
ignore | ||
logger | ||
model | ||
osutil | ||
protocol | ||
rc | ||
relay | ||
scanner | ||
signature | ||
stats | ||
symlinks | ||
sync | ||
tlsutil | ||
upgrade | ||
upnp | ||
versioner |