[Piglit] [PATCH] piglit-summary-html: Use map() to speed up loop in buildDetailValue()
Tom Stellard
tstellar at gmail.com
Sun Sep 11 06:33:18 PDT 2011
I use piglit to capture shaders stats, which generates much more output
than typical usage (~70,000 lines for texCombine). This commit reduces
the time it takes to generate html for one set of results from 6m 22s to
1.7s.
---
piglit-summary-html.py | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/piglit-summary-html.py b/piglit-summary-html.py
index 726319c..6e5082c 100755
--- a/piglit-summary-html.py
+++ b/piglit-summary-html.py
@@ -80,14 +80,14 @@ SummaryPages = {
'fixes': 'fixes.html'
}
+def buildResultListItem(detail):
+ return ResultListItem % { 'detail': buildDetailValue(detail) }
+
def buildDetailValue(detail):
if type(detail) == list:
- items = ''
-
- for d in detail:
- items = items + ResultListItem % { 'detail': buildDetailValue(d) }
+ items = map(buildResultListItem, detail)
+ return ResultList % { 'items': "".join(items) }
- return ResultList % { 'items': items }
elif isinstance(detail, str) or isinstance(detail, unicode):
return ResultMString % { 'detail': cgi.escape(detail) }
--
1.7.3.4
More information about the Piglit
mailing list