From 6d2fdf38ff027d69954236ce60acdb78a57f721e Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Fri, 22 Dec 2017 12:14:11 +0000 Subject: utils.py: _process_list(): Add note that this is a hot codepath --- buildstream/utils.py | 4 ++++ 1 file changed, 4 insertions(+) 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) -- cgit v1.2.1