Skip to content
Commit 80bf1aef authored by Dimitrios Apostolou's avatar Dimitrios Apostolou
Browse files

file: Improve performance of has_same_content by spawning cmp less frequently

* If the two sizes are different, files are different
* Else read the first SMALL_FILE_THRESHOLD bytes (64K)
  * If the first bytes are different, files are different
  * Else first bytes are identical, and if file size is
    <= SMALL_FILE_THRESHOLD then files are identical

Only if all these checks fail, spawn external command `cmp -s` to do the
comparison.
parent ebd3bdcb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment