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: Paul D. Smith
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 08:08:50 -0400 (EDT)

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

Since I don't have any idea what the "nwchem" project is or how its makefiles
work and you haven't provided any short examples, I can't say for sure.

However, it's almost 100% sure that the problem is that the project's
makefiles use a lot of $(shell ...) functions, with recursive variable
assignment; e.g. things like:

  FOO = $(shell some script here)

along with either forcing all variables to be exported:

  .EXPORT_ALL_VARIABLES:

or, just exporting directly a lot of variables that contain shell commands,
like:

  export FOO = $(shell some script here)


This has always been very inefficient because this shell script is invoked
every time the variable is expanded, instead of only once when the variable is
assigned.

But, starting in GNU Make 4.4 this potentially became much more inefficient
due to this change:
https://git.savannah.gnu.org/cgit/make.git/tree/NEWS?h=4.4#n73

To fix this, you should ensure that your makefiles adhere to at least one of
these rules:
* Always use simple assignment (FOO := $(shell ...)) when using the $(shell
...) function unless there's a reason that this can't work.
* Avoid setting .EXPORT_ALL_VARIABLES: special target and instead explicitly
export only the variables you need.



    _______________________________________________________

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]