From 1141490a64cd240093e83dae7013aeeebcdcaef1 Mon Sep 17 00:00:00 2001 From: Alexander Lutay Date: Thu, 19 Sep 2019 13:20:46 +0200 Subject: [PATCH] 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 --- helper/build_config | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/helper/build_config b/helper/build_config index 53ca5d6c..869f9f67 100755 --- a/helper/build_config +++ b/helper/build_config @@ -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}" }