On Wed, 2023-10-04 at 23:20 +0200, Till Backhaus wrote:
> This rather short Makefile shows exponential runtime depending on the
> number of variables. 
> export
> 
> VAR_1 ?= $(shell echo 1)
> VAR_2 ?= $(shell echo 2) 
> VAR_3 ?= $(shell echo 3)
> VAR_4 ?= $(shell echo 4)
> VAR_5 ?= $(shell echo 5)
> VAR_6 ?= $(shell echo 6)
> VAR_7 ?= $(shell echo 7)
> 
> foo:
>         echo foo
> 
> Runtime with 7 variables is ~20s on reasonably current hardware (AMD
> Ryzen 7 4750U):
> 
> time make foo 
> echo foo
> foo
> 
> real 0m21.663s
> user 0m4.082s
> sys 0m18.027s

I'm no expert but this looks like the "expected" result of this feature.

Perhaps it should be disabled by default?  Or be enabled only for non-
recursive variables?

-- 
Bahman

Join the chatter on Matrix:
         🗣️ https://matrix.to/#/#.mk:matrix.org
      
Subscribe to the Lemmy community:
         🐭 https://lemmy.ml/c/makefile


Reply via email to