[Piglit] [PATCH] piglit-summary-html: Use map() to speed up loop in buildDetailValue()

Ian Romanick idr at freedesktop.org
Tue Sep 13 08:55:55 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/11/2011 08:33 AM, Tom Stellard wrote:
> 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.

This looks good.  I checked to make sure it doesn't make my use-case
slower.  Any chance you could make piglit-summary-html faster when you
have, say, 20 results files to process? :)

Tested-by: Ian Romanick <ian.d.romanick at intel.com>

> --- 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) }
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5vfQsACgkQX1gOwKyEAw8s7QCfZ2Qsz84Qz4g9ybsXvz5pYGM6
zwwAoJBmhsb6RRdgBGkwjMX3TexAShHj
=lFMM
-----END PGP SIGNATURE-----


More information about the Piglit mailing list