diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2017-12-22 12:14:11 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2017-12-22 12:17:48 +0000 |
commit | 6d2fdf38ff027d69954236ce60acdb78a57f721e (patch) | |
tree | d832a11b76cf44110c2d9170697c98314cb143a1 | |
parent | 7eea41ad6d5310d4d45d620814da843b6dc8f1c8 (diff) | |
download | buildstream-sam/symlinks-2.tar.gz |
utils.py: _process_list(): Add note that this is a hot codepathsam/symlinks-2
-rw-r--r-- | buildstream/utils.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/buildstream/utils.py b/buildstream/utils.py index 3fb55efe3..015c276e7 100644 --- a/buildstream/utils.py +++ b/buildstream/utils.py @@ -550,6 +550,10 @@ def _process_list(srcdir, destdir, filelist, actionfunc, result, ignore_missing= # links which lead to directories before processing files inside those # directories. # + # Be aware that this is a performance sensitive loop. The filelist could + # easily have 100,000 files and the block below will run for each one. + # Python's os.path() module is not particularly efficient so the less work + # we do per-file the better. for path in sorted(filelist): srcpath = os.path.join(srcdir, path) destpath = os.path.join(destdir, path) |