dupemerge: maybe improve seek performance by sorting perl hashes
authorZygo Blaxell <zblaxell@faye.furryterror.org>
Wed, 6 Jan 2010 16:10:04 +0000 (11:10 -0500)
committerZygo Blaxell <zblaxell@waya.furryterror.org>
Sat, 9 Jan 2010 02:17:48 +0000 (21:17 -0500)
commit95742bfa9d5a1f33ce77689f0b2fb93bdf888e85
tree31a03ad9334a172b741dec185c9b30dc15b5bfe1
parent2f607d26931ff8ed86b7f41d19f62679f8ac916d
dupemerge: maybe improve seek performance by sorting perl hashes

Thank Johannes Niess <Linux@johannes-niess.de> for this idea.

To improve seek performance, choose inodes for linking in a fixed order.
This will mean that two directories with multiple identical files will
end up with links to the copies with lower inode numbers.  This is an
improvement over the previous result, which was that both directories
would end up with randomly chosen files from both directories.

The sort order isn't strictly numeric; however, it's hopefully close
enough.

As a crude heuristic, we assume that inode numbers approximate file
position on disk, and file names approximate typical usage patterns.
Previously we used the perl hash semantics, which are mostly random
and might change depending on the numbers of files considered.
faster-dupemerge