Skip to contentSkip to conversation

bitbake.conf: Use immediate expansion for os.uname()

PATCH New Richard Purdie 1 participant 1 message May 26, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bitbake.conf: Use immediate expansion for os.uname()

Use immediate expansion for BUILD_ARCH and BUILD_OS since there is no point in repeatedly calling os.uname() throughout parsing. This is worth around 2% of parsing time, small but measurable.

meta/conf/bitbake.conf +4 -2
index 8653a7f..eb0208d 100644
@@ -81,8 +81,10 @@ ROOT_HOME ??= "/home/root"
 # Architecture-dependent build variables.
 ##################################################################
 
-BUILD_ARCH = "${@os.uname()[4]}"
-BUILD_OS = "${@os.uname()[0].lower()}"
+# Immediate expansion since there is no point in reapeatedly calling
+# os.uname() throughout parsing
+BUILD_ARCH := "${@os.uname()[4]}"
+BUILD_OS := "${@os.uname()[0].lower()}"
 BUILD_VENDOR = ""
 BUILD_SYS = "${BUILD_ARCH}${BUILD_VENDOR}-${BUILD_OS}"
 BUILD_PREFIX = ""