TT#65907 Speedup 'ngcpcfg build' on 25% for non-docker installations

We are calling slow Perl command to move files to workaround Docker problem
and losing 25% of performance on every NGCP installation in production.
Let's call slow workaround when it is necessary only (in Docker).

Command: time ngcpcfg build
Original results: real   0m19.976s
Current  results: real   0m15.286s

Change-Id: Iac787c0fcdb4182d71b6305ebbba5ea3193e76c8
changes/50/33650/6
Alexander Lutay 7 years ago
parent 8209a5a136
commit 1141490a64

@ -93,8 +93,12 @@ move()
local src="$1"
local dst="$2"
perl -MFile::Copy=mv \
-E "mv('${src}', '${dst}') or die 'error: cannot move $src to $dst: \$!\n'"
if [ -e /.dockerinit ] || [ -e /.dockerenv ] ; then
perl -MFile::Copy=mv \
-E "mv('${src}', '${dst}') or die 'error: cannot move $src to $dst: \$!\n'"
else
mv "${src}" "${dst}"
fi
rm -f "${src}"
}

Loading…
Cancel
Save