qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v7 19/21] simplebench/results_to_text: add difference line to


From: Max Reitz
Subject: Re: [PATCH v7 19/21] simplebench/results_to_text: add difference line to the table
Date: Fri, 13 Nov 2020 17:21:01 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0

On 21.10.20 16:58, Vladimir Sementsov-Ogievskiy wrote:
Performance improvements / degradations are usually discussed in
percentage. Let's make the script calculate it for us.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
  scripts/simplebench/results_to_text.py | 67 +++++++++++++++++++++++---
  1 file changed, 60 insertions(+), 7 deletions(-)

diff --git a/scripts/simplebench/results_to_text.py 
b/scripts/simplebench/results_to_text.py
index 479f7ac1d4..56fdacf7ca 100644
--- a/scripts/simplebench/results_to_text.py
+++ b/scripts/simplebench/results_to_text.py

[...]

+            for j in range(0, i):
+                env_j = results['envs'][j]
+                res_j = case_results[env_j['id']]
+                cell += ' '
+
+                if 'average' not in res_j:
+                    # Failed result
+                    cell += '--'
+                    continue
+
+                col_j = tab[0][j + 1] if named_columns else ''
+                diff_pr = round((res['average'] - res_j['average']) /
+                                res_j['average'] * 100)
+                cell += f' {col_j}{diff_pr:+}%'

Contrasting to v6, you added the "cell += ' '" line, dropped a space in the "cell += '--'" line (was: "cell += ' --'"), but kept the space here. I would have assumed that the leading space is dropped here, too. But I don’t quite know, what I should be expecting, so.

Anyway, I’ll just leave this here:

Reviewed-by: Max Reitz <mreitz@redhat.com>

+            row.append(cell)
+        tab.append(row)
+
+    return f'All results are in {dim}\n\n' + tabulate.tabulate(tab)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]