syncthing/lib/model
greatroar 807a6b1022
lib/model: Optimize jobQueue performance and memory use (#8023)
By truncating time.Time to an int64 nanosecond count, we lose the
ability to precisely order timestamps before 1678 or after 2262, but we
gain (linux/amd64, Go 1.17.1):

name                      old time/op    new time/op    delta
JobQueuePushPopDone10k-8    2.85ms ± 5%    2.29ms ± 2%  -19.80%  (p=0.000 n=20+18)
JobQueueBump-8              34.0µs ± 1%    29.8µs ± 1%  -12.35%  (p=0.000 n=19+19)

name                      old alloc/op   new alloc/op   delta
JobQueuePushPopDone10k-8    2.56MB ± 0%    1.76MB ± 0%  -31.31%  (p=0.000 n=18+13)

name                      old allocs/op  new allocs/op  delta
JobQueuePushPopDone10k-8      23.0 ± 0%      23.0 ± 0%     ~     (all equal)

Results for BenchmarkJobQueueBump are with the fixed version, which no
longer depends on b.N for the amount of work performed. rand.Rand.Intn
is cheap at ~10ns per iteration.
2021-10-29 20:20:46 +02:00
..
mocks lib/model: Don't reset db while folder is running (fixes #7935) (#7936) 2021-09-11 17:14:47 +02:00
testdata lib/model: Spurious tmp file (ref #6607) (#6609) 2020-05-07 08:49:59 +02:00
blockpullreorderer_test.go all: Remove miscellaneous vestigial code (#7495) 2021-03-17 22:23:12 +01:00
blockpullreorderer.go lib/model: Add support for different puller block ordering (#6587) 2020-05-11 22:44:04 +01:00
debug.go all, lib/logger: Refactor SetDebug calls (#6054) 2019-10-04 13:03:34 +02:00
deviceactivity_test.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
deviceactivity.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
devicedownloadstate_test.go all: Move remaining protos to use the vanity plugin (#7009) 2020-10-02 08:07:05 +02:00
devicedownloadstate.go all: Move remaining protos to use the vanity plugin (#7009) 2020-10-02 08:07:05 +02:00
doc.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
fakeconns_test.go lib/connections: Trigger dialer when connection gets closed (#7753) 2021-06-17 13:57:44 +02:00
folder_recvenc.go lib/model: Schedule pull after revert on recv-enc (#7892) 2021-08-17 09:24:10 +02:00
folder_recvonly_test.go lib/model: Fix wrongly hardcoded arguments in test helper (#7749) 2021-06-05 17:01:23 +02:00
folder_recvonly.go lib/model: Typo in folder_recvonly.go (#7919) 2021-09-01 07:41:18 +02:00
folder_sendonly.go lib/connections: Dial devices in parallel (#7783) 2021-06-25 11:38:04 +02:00
folder_sendrecv_test.go lib/fs: Improve case conflict error message (fixes #7827) (#7829) 2021-08-01 22:44:49 +02:00
folder_sendrecv.go lib/model: Set mod. time after writing trailer in shortcut (ref #7992) 2021-10-24 16:50:30 +02:00
folder_summary.go build: List go:generate tools in tools.go (#7599) 2021-05-08 12:52:06 +02:00
folder_test.go lib/fs: Properly handle case insensitive systems (fixes #1787, fixes #2739, fixes #5708) 2020-07-28 11:15:11 +02:00
folder.go lib/model: Do not wait for scan when setting ignores (fixes #7893) (#7891) 2021-08-17 09:23:33 +02:00
folderstate.go all: Truncate some timestamps (fixes #7457) (#7459) 2021-03-12 10:35:10 +01:00
indexhandler.go lib/model: Pull when a new connection is established (fixes #8012) (#8013) 2021-10-20 18:55:22 +02:00
model_test.go lib/connections: Dial devices in parallel (#7783) 2021-06-25 11:38:04 +02:00
model.go lib/model: Limit the number of default hashers on Android (ref #2220) 2021-10-29 10:06:52 +02:00
progressemitter_test.go lib: Use counterfeiter to mock interfaces in tests (#7375) 2021-03-03 08:53:50 +01:00
progressemitter.go all: Implement suture v4-api (#6947) 2020-11-17 13:19:04 +01:00
queue_test.go lib/model: Optimize jobQueue performance and memory use (#8023) 2021-10-29 20:20:46 +02:00
queue.go lib/model: Optimize jobQueue performance and memory use (#8023) 2021-10-29 20:20:46 +02:00
requests_test.go lib/model: Ensure indexes are only received after checking IDs (ref #7649) (#7689) 2021-06-03 14:58:50 +02:00
sentdownloadstate.go all: Move remaining protos to use the vanity plugin (#7009) 2020-10-02 08:07:05 +02:00
sharedpullerstate_test.go lib/model: Use errors.Wrap for pull errors (#5563) 2019-03-04 13:01:52 +00:00
sharedpullerstate.go lib/model: Write trailer when shortcutting on recv-enc (fixes #7991) (#7992) 2021-10-05 11:23:27 +02:00
testos_test.go lib/fs: Properly handle case insensitive systems (fixes #1787, fixes #2739, fixes #5708) 2020-07-28 11:15:11 +02:00
testutils_test.go lib/model: Fix wrongly hardcoded arguments in test helper (#7749) 2021-06-05 17:01:23 +02:00
util.go all: Send deadlocks as failures, crash only as a last resort (#7785) 2021-07-27 21:27:52 +02:00
utils_test.go all: Remove potentially problematic errors from panics (fixes #5839) (#5912) 2019-07-31 10:53:35 +02:00