]> git.ipfire.org Git - thirdparty/rsync.git/commit
xattrs: maintain a hashtable in order to speed up find_matching_xattr()
authorStefan Metzmacher <metze@samba.org>
Fri, 22 Jul 2016 17:46:46 +0000 (19:46 +0200)
committerWayne Davison <wayned@samba.org>
Sun, 14 Aug 2016 21:37:49 +0000 (14:37 -0700)
commit6e3b2102bc2c7df42aa4961a6460eae954c95af2
tree0065e1eabaad53abec562b910d1088b62e619dd6
parentcc29b94d0f3ae5d8f96dd0daaf282ed9a73bfe73
xattrs: maintain a hashtable in order to speed up find_matching_xattr()

As a testcase I've used one directory on gpfs with 1000000 files,
each with an xattr called 'name$i' having a value of 'value$i'.
So we also have 1000000 unique xattrs. The source and dest directories
are already in sync before. So the rsync command is basically a noop,
just verifying that everything is already in sync.

The results before this patchset are:

  [gpfs]# time rsync -a -P -X -q source-xattr/ dest-with-xattr/

  real    8m46.191s
  user    6m29.016s
  sys     0m24.883s

  [gpfs]# time rsync -a -P -q source-xattr/ dest-without-xattr/

  real    1m58.462s
  user    0m0.957s
  sys     0m11.801s

With the patchset I got:

  [gpfs]# time /gpfs/rsync.install/bin/rsync -a -P -X -q source-xattr/ dest-with-xattr/

  real    2m4.150s
  user    0m1.917s
  sys     0m17.077s

  [gpfs]# time /gpfs/rsync.install/bin/rsync -a -P -q source-xattr/ dest-without-xattr/
  real    1m59.534s
  user    0m0.924s
  sys     0m11.599s

It means the time in userspace dropped from 6m29.016s down to 0m1.917s!
Without -X we get ~ 0m0.9s with or without the patch.

Part of a patchset for bug 5324.
xattrs.c