Skip to contentSkip to conversation

ptest: d.keys() is slow, use a list instead

PATCH In review Richard Purdie 2 participants 2 messages Jan 14, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ptest: d.keys() is slow, use a list instead

Unfortunately d.keys is extremely slow. Using a list in this case should be fine since the addtask lines are immediately above the code and aren't going to change often.

---

meta/classes/ptest.bbclass +1 -1
index e5bbb89..caf7101 100644
@@ -55,6 +55,6 @@ python () {
 
     # Remove all '*ptest_base' tasks when ptest is not enabled
     if not(d.getVar('PTEST_ENABLED', True) == "1"):
-        for i in filter(lambda k: d.getVarFlag(k, "task") and k.endswith("ptest_base"), d.keys()):
+        for i in ['do_configure_ptest_base', 'do_compile_ptest_base', 'do_install_ptest_base']:
             bb.build.deltask(i, d)
 }
#1 lore raw
Quoted 6 lines · Richard Purdie

Unfortunately d.keys is extremely slow. Using a list in this case should be fine since the addtask lines are immediately above the code and aren't going to change often.

A code comment stating it needs to be update would be good.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750