[oe-commits] Richard Purdie : lib/oe/path: Fix performance issue got copyhardlinktree()

git at git.openembedded.org git at git.openembedded.org
Fri Nov 8 17:26:31 UTC 2013


Module: openembedded-core.git
Branch: master-next
Commit: 9da90a8e9915efd306347e29366da165f1df4430
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=9da90a8e9915efd306347e29366da165f1df4430

Author: Richard Purdie <richard.purdie at linuxfoundation.org>
Date:   Fri Nov  8 15:19:05 2013 +0000

lib/oe/path: Fix performance issue got copyhardlinktree()

With the directory copy was added to avoid race issues, it wasn't noticed that
tar was recursing the directories and copying files too. This is completely
crazy when we hardlink those files in the next command.

Resolve the issue by telling tar not to recurse. This gives a significant
performance boost to various parts of the system (do_package for linux-yocto
256s -> 178s for example).

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/lib/oe/path.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
index 1310e38..d0588ba 100644
--- a/meta/lib/oe/path.py
+++ b/meta/lib/oe/path.py
@@ -93,7 +93,7 @@ def copyhardlinktree(src, dst):
     if (os.stat(src).st_dev ==  os.stat(dst).st_dev):
         # Need to copy directories only with tar first since cp will error if two 
         # writers try and create a directory at the same time
-        cmd = 'cd %s; find . -type d -print | tar -cf - -C %s -p --files-from - | tar -xf - -C %s' % (src, src, dst)
+        cmd = 'cd %s; find . -type d -print | tar -cf - -C %s -p --files-from - --no-recursion | tar -xf - -C %s' % (src, src, dst)
         check_output(cmd, shell=True, stderr=subprocess.STDOUT)
         if os.path.isdir(src):
             src = src + "/*"



More information about the Openembedded-commits mailing list