[Mesa-dev] [PATCH] radv-report: Show biggest improvements

Samuel Pitoiset samuel.pitoiset at gmail.com
Thu Nov 22 07:51:40 UTC 2018


Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>

On 11/22/18 1:52 AM, Timothy Arceri wrote:
> Being able to see improvements as well as regressions is useful
> during the development of shader opts.
> 
> Ported from commit 8f0c7aca8683 in shader-db
> ---
>   radv-report.py | 30 ++++++++++++++++++++++++++++++
>   1 file changed, 30 insertions(+)
> 
> diff --git a/radv-report.py b/radv-report.py
> index 6396db0..027c1aa 100755
> --- a/radv-report.py
> +++ b/radv-report.py
> @@ -675,6 +675,36 @@ def print_tables(before_all_results, after_all_results):
>           if num > 0:
>               print
>   
> +    # biggest improvements
> +    metrics = si_stats().metrics
> +    for i in range(len(metrics)):
> +        field = metrics[i][0]
> +        num = 0
> +        more_is_better = metrics[i][0] == 'maxwaves'
> +
> +        if more_is_better:
> +            sort_key = lambda v: -v[1].diff.__dict__[field]
> +        else:
> +            sort_key = lambda v: v[1].diff.__dict__[field]
> +
> +        for name, stats in sorted(shaders.items(), key = sort_key):
> +            if more_is_better:
> +                if stats.diff.__dict__[field] <= 0:
> +                    continue
> +            else:
> +                if stats.diff.__dict__[field] >= 0:
> +                    continue
> +
> +            if num == 0:
> +                print_yellow(" BIGGEST IMPROVEMENTS - {:49}".format(metrics[i][1]))
> +                print_yellow(" Before After     Delta Percentage")
> +            stats.print_regression(name, field)
> +            num += 1
> +            if num == num_listed:
> +                break
> +        if num > 0:
> +            print
> +
>       # percentages
>       legend = "Shaders     SGPRs     VGPRs SpillSGPR SpillVGPR  PrivVGPR   Scratch  CodeSize  MaxWaves     Waits"
>       print_yellow(" PERCENTAGE DELTAS    " + legend)
> 


More information about the mesa-dev mailing list