From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dan.rpsys.net ([93.97.175.187]) by linuxtogo.org with esmtp (Exim 4.72) (envelope-from ) id 1U29gP-0002jG-Gj for openembedded-core@lists.openembedded.org; Mon, 04 Feb 2013 01:13:20 +0100 Received: from localhost (dan.rpsys.net [127.0.0.1]) by dan.rpsys.net (8.14.4/8.14.4/Debian-2.1ubuntu1) with ESMTP id r1401FUR020480; Mon, 4 Feb 2013 00:01:24 GMT X-Virus-Scanned: Debian amavisd-new at dan.rpsys.net X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from dan.rpsys.net ([127.0.0.1]) by localhost (dan.rpsys.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id qHGzr75rRFBy; Mon, 4 Feb 2013 00:01:24 +0000 (GMT) Received: from ted (bebox.config [93.97.175.187] (may be forged)) (authenticated bits=0) by dan.rpsys.net (8.14.4/8.14.4/Debian-2.1ubuntu1) with ESMTP id r1401E9X020465 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 4 Feb 2013 00:01:15 GMT Received: from richard by ted with local (Exim 4.80) (envelope-from ) id 1U29Pm-0000Ya-J6; Sun, 03 Feb 2013 23:56:02 +0000 From: Richard Purdie To: openembedded-core@lists.openembedded.org Date: Sun, 3 Feb 2013 23:55:51 +0000 Message-Id: X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: In-Reply-To: References: Subject: [PATCH 21/22] package.bbclass: Pre-expand some variables to save time X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 00:13:22 -0000 Signed-off-by: Richard Purdie --- meta/classes/package.bbclass | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index 2c3f173..2bae65b 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass @@ -1798,6 +1798,20 @@ python do_package () { return ########################################################################### + # Optimisations + ########################################################################### + + # Contunually rexpanding complex expressions is inefficient, particularly when + # we write to the datastore and invalidate the expansion cache. This code + # pre-expands some frequently used variables + + def expandVar(x, d): + d.setVar(x, d.getVar(x, True)) + + for x in 'PN', 'PV', 'BPN', 'TARGET_SYS', 'EXTENDPRAUTO': + expandVar(x, d) + + ########################################################################### # Setup PKGD (from D) ########################################################################### -- 1.7.10.4