Commit b684d0af authored by Tom Stellard's avatar Tom Stellard Committed by Marek Olšák

piglit-summary-html: Use map() to speed up loop in buildDetailValue()

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.
Tested-by: default avatarIan Romanick <ian.d.romanick@intel.com>
parent b0dba417
......@@ -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) }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment