All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: git@vger.kernel.org
Cc: Andi Kleen <ak@linux.intel.com>
Subject: [PATCH 5/5] Add a little script to compare two make perf runs
Date: Fri,  4 Jul 2014 16:43:52 -0700	[thread overview]
Message-ID: <1404517432-25185-6-git-send-email-andi@firstfloor.org> (raw)
In-Reply-To: <1404517432-25185-1-git-send-email-andi@firstfloor.org>

From: Andi Kleen <ak@linux.intel.com>

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 diff-res | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100755 diff-res

diff --git a/diff-res b/diff-res
new file mode 100755
index 0000000..90d57be
--- /dev/null
+++ b/diff-res
@@ -0,0 +1,26 @@
+#!/usr/bin/python
+# compare two make perf output file
+# this should be the results only without any header
+import argparse
+import math, operator
+from collections import OrderedDict
+
+ap = argparse.ArgumentParser()
+ap.add_argument('file1', type=argparse.FileType('r'))
+ap.add_argument('file2', type=argparse.FileType('r'))
+args = ap.parse_args()
+
+cmp = (OrderedDict(), OrderedDict())
+for f, k in zip((args.file1, args.file2), cmp):
+    for j in f:
+        num = j[59:63]
+        name = j[:59]
+        k[name] = float(num)
+
+for j in cmp[0].keys():
+    print j, cmp[1][j] - cmp[0][j]
+
+def geomean(l):
+   return math.pow(reduce(operator.mul, filter(lambda x: x != 0.0, l)), 1.0 / len(l))
+
+print "geomean %.2f -> %.2f" % (geomean(cmp[0].values()), geomean(cmp[1].values()))
-- 
2.0.1

  parent reply	other threads:[~2014-07-04 23:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-04 23:43 Fix the bitrotted profile feedback build Andi Kleen
2014-07-04 23:43 ` [PATCH 1/5] Use BASIC_FLAGS for profile feedback Andi Kleen
2014-07-04 23:43 ` [PATCH 2/5] Don't define away __attribute__ on gcc Andi Kleen
2014-07-04 23:43 ` [PATCH 3/5] Run the perf test suite for profile feedback too Andi Kleen
2014-07-07 21:06   ` Junio C Hamano
2014-07-07 22:15     ` Andi Kleen
2014-07-04 23:43 ` [PATCH 4/5] Fix profile feedback with -jN and add profile-fast Andi Kleen
2014-07-04 23:43 ` Andi Kleen [this message]
2014-07-06 16:12   ` [PATCH 5/5] Add a little script to compare two make perf runs Bert Wesarg
2014-07-06 16:15     ` Andi Kleen
2014-07-06 16:46       ` Bert Wesarg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1404517432-25185-6-git-send-email-andi@firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=ak@linux.intel.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.