bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #65533] gmake-4.4.1 has a performance regression: at least the nwch


From: Martin Dorey
Subject: [bug #65533] gmake-4.4.1 has a performance regression: at least the nwchem project now builds much slower
Date: Fri, 29 Mar 2024 12:58:33 -0400 (EDT)

Follow-up Comment #3, bug #65533 (group make):

[comment #2 comment #2:]

> the gmake process should consume close to 100% of CPU much of the time doing
these variable expansions
I like your thinking but that's that's not what Paul's theory predicts. 
Perhaps an example will help to explain why not.  Given:

martind@stormy:~/tmp/make-65533$ cat Makefile 
export FOO = $(shell set -x; echo FOO; sleep 0.1)
export BAR = $(shell set -x; echo BAR; sleep 0.1)
export BAZ = $(shell set -x; echo BAZ; sleep 0.1)
export QUX = $(shell set -x; echo QUX; sleep 0.1)
$(info QUX is $(QUX))
all:;
martind@stormy:~/tmp/make-65533$ 

... then older versions of Gnu Make, here represented by 4.2.1, behave like
this:

martind@stormy:~/tmp/make-65533$ time /usr/bin/make
+ echo QUX
+ sleep 0.1
QUX is QUX
make: 'all' is up to date.

real    0m0.105s
user    0m0.004s
sys     0m0.000s
martind@stormy:~/tmp/make-65533$ 

The new version of Gnu Make does this:

martind@stormy:~/tmp/make-65533$ time make
+ echo BAZ
+ sleep 0.1
+ echo BAR
+ sleep 0.1
+ echo BAR
+ sleep 0.1
+ echo BAZ
+ sleep 0.1
+ echo FOO
+ sleep 0.1
+ echo BAZ
+ sleep 0.1
+ echo FOO
+ sleep 0.1
+ echo FOO
+ sleep 0.1
+ echo BAZ
+ sleep 0.1
+ echo BAR
+ sleep 0.1
+ echo BAR
+ sleep 0.1
+ echo FOO
+ sleep 0.1
+ echo FOO
+ sleep 0.1
+ echo BAR
+ sleep 0.1
+ echo BAZ
+ sleep 0.1
+ echo QUX
+ sleep 0.1
QUX is QUX
make: 'all' is up to date.

real    0m1.647s
user    0m0.036s
sys     0m0.004s

1 QUX but 5 each of FOO, BAR and BAZ - it takes 16 times as long and
essentially none of the time is going in Gnu Make's string manipulation, but
all in the shell commands.  It's not the contention that the shell commands
are themselves expensive, though they will involve more work than Gnu Make's
variable expansion, but that the number of invocations of them has increased
exponentially.  4 invocations were perhaps intended, though only 1 was
previously experienced, but 16 have now happened.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65533>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]