syncthing/internal
Jakob Borg 90a1d99785 Reuse a timer instead of allocating a new one in subscription.Poll
This is surprisingly memory expensive when Poll gets called a lot, such
as when syncing lots of small files generating itemstarted/itemfinished
events. It's line number three in this heap profile on the
TestBenchmarkManyFiles test:

	jb@syno:~/src/github.com/syncthing/syncthing/test (master) $ go tool pprof ../bin/syncthing heap-13194.pprof
	Entering interactive mode (type "help" for commands)
	(pprof) top
	80.91MB of 83.05MB total (97.42%)
	Dropped 1024 nodes (cum <= 0.42MB)
	Showing top 10 nodes out of 85 (cum >= 1.75MB)
	      flat  flat%   sum%        cum   cum%
	      32MB 38.53% 38.53%    32.01MB 38.54%  github.com/syndtr/goleveldb/leveldb/memdb.New
	   22.16MB 26.68% 65.21%    22.16MB 26.68%  github.com/syndtr/goleveldb/leveldb/util.(*BufferPool).Get
	   13.02MB 15.68% 80.89%    13.02MB 15.68%  time.NewTimer
	    6.94MB  8.35% 89.24%     6.94MB  8.35%  github.com/syndtr/goleveldb/leveldb/memdb.(*DB).Put
	    3.18MB  3.82% 93.06%     3.18MB  3.82%  github.com/calmh/xdr.(*Reader).ReadBytesMaxInto

With this change the allocation is removed entirely.
2015-05-23 20:38:41 +02:00
..
auto Translation update 2015-05-15 10:46:47 +02:00
beacon Use a socket per interface for v6 multicast (fixes #1563) 2015-04-06 20:55:50 +02:00
config Virtual mtime support for environments that don't support altering mtimes (fixes #831) 2015-05-13 14:57:29 +00:00
db Refactor GetMtime for early return 2015-05-14 08:26:21 +02:00
discover Don't check interface flags on Windows 2015-05-17 16:42:26 +01:00
events Reuse a timer instead of allocating a new one in subscription.Poll 2015-05-23 20:38:41 +02:00
fnmatch Added test for combining case insensitive and negated patterns (fixes #1678) 2015-05-01 00:58:44 +02:00
ignore Run vet and lint. Make us lint clean. 2015-04-29 10:38:02 +02:00
model Run benchmarks when running tests 2015-05-23 15:08:17 +02:00
osutil Support the creation of top-level folders on Windows (fixes #1822) 2015-05-21 19:21:19 +02:00
scanner Support the creation of top-level folders on Windows (fixes #1822) 2015-05-21 19:21:19 +02:00
stats MPLv2 2015-03-17 16:02:27 +01:00
symlinks typos and spelling correction 2015-04-29 15:59:47 +02:00
sync Run vet and lint. Make us lint clean. 2015-04-29 10:38:02 +02:00
upgrade typos and spelling correction 2015-04-29 15:59:47 +02:00
upnp Set permanent UPnP lease when required (fixes #1831) 2015-05-21 10:48:40 +02:00
versioner Support the creation of top-level folders on Windows (fixes #1822) 2015-05-21 19:21:19 +02:00