content comparison - how does it compare?

Discuss new features and functions
primexx
Posts: 5
Joined: 23 Oct 2019

Post by primexx • 23 Oct 2019, 21:32

I'm curious how the content comparison works under the hood. Does it use hashing? straight up bit-for-bit comparison?

and particularly, does the comparison run through the whole file always or does it just break and start copying as soon as it sees the first bit that is different?

User avatar
Plerry
Posts: 742
Joined: 22 Aug 2012

Post by Plerry • 24 Oct 2019, 06:53

FFS does a full (bit-by-bit, if you like) comparison.
FFS can/does not use a hash.
Using hashes would require software to run locally at each of the locations involved in the sync, which is often not possible.
FFS only needs to run on any single machine that can access each of the locations involved in the sync.

I suppose (but, I'm not sure) FFS stops the comparison (of any pair of left-right files) as soon as it discovers any differences.
However, FFS will not start copying/syncing "as soon as it sees the first bit that is different".
FFS always first finishes its complete compare-phase (of all files involved) before automatically or manually starting the sync-phase.

primexx
Posts: 5
Joined: 23 Oct 2019

Post by primexx • 28 Oct 2019, 23:45

Oh thanks, yeah that makes sense. I suppose what I really want to know is whether it stops comparison of a file as soon as it sees the first different bit, or if it still compares the rest of the file anyway. Seems like it'd be most efficient to stop and move on as soon as it knows that the file has at least 1 difference.

xCSxXenon
Posts: 160
Joined: 11 Jun 2019

Post by xCSxXenon • 07 Nov 2019, 20:08

Exactly the case. There is no reason to continue a compare when the is even a single bit difference