mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-22 22:58:25 +00:00
bd0acd04b1
Having a separate mutex for the three or four instructions needed to fetch and increment nextID means the overhead exceeds the cost of this operation. nextID is now handled inside the critical section for awaiting instead, while the more expensive channel creation has been moved outside it. This is mostly a simplification, though it may have minor performance benefits in some situations. The single-threaded sender benchmark shows no significant difference: name old speed new speed delta RequestsRawTCP-8 55.3MB/s ± 7% 56.6MB/s ± 6% ~ (p=0.190 n=10+10) RequestsTLSoTCP-8 20.5MB/s ±20% 20.8MB/s ± 8% ~ (p=0.604 n=10+9)