From a4155e8512fa66e431833b1399be6c2c55ce8f65 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Mon, 9 Apr 2018 16:30:06 -0700 Subject: [PATCH] Delay eval to save memory use in create-suite-dependencies Instead of passing the entire contents of $(COMPATIBILITY.$(suite).FILES) to eval, which may keep that string around, delay the evaluation of that, and the new files until inside the eval. This saves ~2.8GB: 7.4GB -> 4.6GB of ckati max resident memory for a relatively small internal build. It also saves ~10% of the makefile loading time (81 -> 73 seconds). Test: build-aosp_arm.ninja is identical Change-Id: If45a4796f1bbf6d67dff388ea877a6115a4e06f4 --- core/definitions.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/definitions.mk b/core/definitions.mk index 425da45a8..fe966886c 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -3117,7 +3117,7 @@ endef define create-suite-dependencies $(foreach suite, $(LOCAL_COMPATIBILITY_SUITE), \ $(eval COMPATIBILITY.$(suite).FILES := \ - $(COMPATIBILITY.$(suite).FILES) $(foreach f,$(my_compat_dist_$(suite)),$(call word-colon,2,$(f))))) \ + $$(COMPATIBILITY.$(suite).FILES) $$(foreach f,$$(my_compat_dist_$(suite)),$$(call word-colon,2,$$(f))))) \ $(eval $(my_all_targets) : $(call copy-many-files, \ $(sort $(foreach suite,$(LOCAL_COMPATIBILITY_SUITE),$(my_compat_dist_$(suite)))))) endef