public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Martin Liska <marxin@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/marxin/heads/fixinclude-speed-up)] Speed up fixincludes. Date: Thu, 3 Feb 2022 14:55:42 +0000 (GMT) [thread overview] Message-ID: <20220203145542.ED1D53858C60@sourceware.org> (raw) https://gcc.gnu.org/g:7c16ffb796a7f646ce5b8ea2ca32dca2418a59b2 commit 7c16ffb796a7f646ce5b8ea2ca32dca2418a59b2 Author: Martin Liska <mliska@suse.cz> Date: Thu Feb 3 15:49:43 2022 +0100 Speed up fixincludes. In my case: $ rm ./stmp-fixinc ; time make -j16 takes 17 seconds, where I can reduce it easily with the suggested change. Then I get to 11.2 seconds. The scripts searches ~2500 folders in my case with total 20K header files. fixincludes/ChangeLog: * fixinc.in: Use mkdir -p rather that a loop. Diff: --- fixincludes/fixinc.in | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/fixincludes/fixinc.in b/fixincludes/fixinc.in index de5a37f6acc..cdc0ca2e4c4 100755 --- a/fixincludes/fixinc.in +++ b/fixincludes/fixinc.in @@ -258,13 +258,9 @@ then echo "All directories (including links to directories):" echo $all_dirs fi -for file in $all_dirs; do - rm -rf $LIB/$file - if [ ! -d $LIB/$file ] - then mkdir $LIB/$file - fi -done -mkdir $LIB/root +cd $LIB +mkdir -p $all_dirs +cd .. # # # # # # # # # # # # # # # # # # # # # #
next reply other threads:[~2022-02-03 14:55 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-02-03 14:55 Martin Liska [this message] 2022-02-03 15:40 Martin Liska
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220203145542.ED1D53858C60@sourceware.org \ --to=marxin@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).