Add indirection for large version vectors. (#6376)
This adds indirection of large version vectors in the same manner as we already to block lists. The effect is the same: less duplicated data in some situations. To mitigate the impact for when this indirection wouldn't be needed I've added an indirection cutoff for both blocks and the new version vector stuff: we don't do the indirection at all for small block lists or small version vectors, instead storing it directly like we used to do. This is faster for small files and small setups.
This commit is contained in:
+5
-1
@@ -924,6 +924,7 @@ func (m *model) handleIndex(deviceID protocol.DeviceID, folder string, fs []prot
|
||||
// The local attributes should never be transmitted over the wire.
|
||||
// Make sure they look like they weren't.
|
||||
fs[i].LocalFlags = 0
|
||||
fs[i].VersionHash = nil
|
||||
}
|
||||
files.Update(deviceID, fs)
|
||||
|
||||
@@ -1968,7 +1969,10 @@ func (s *indexSender) sendIndexTo(ctx context.Context) error {
|
||||
if f.IsReceiveOnlyChanged() {
|
||||
f.Version = protocol.Vector{}
|
||||
}
|
||||
f.LocalFlags = 0 // never sent externally
|
||||
|
||||
// never sent externally
|
||||
f.LocalFlags = 0
|
||||
f.VersionHash = nil
|
||||
|
||||
previousWasDelete = f.IsDeleted()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user