From patchwork Mon Sep 18 17:40:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 22923 Received: (qmail 82395 invoked by alias); 18 Sep 2017 17:40:27 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 82297 invoked by uid 89); 18 Sep 2017 17:40:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_NEUTRAL autolearn=ham version=3.3.2 spammy=UD:png X-HELO: homiemail-a47.g.dreamhost.com From: Siddhesh Poyarekar To: libc-alpha@sourceware.org Subject: [PATCH 2/2] benchtests: Add a new argument -t to read throughput results Date: Mon, 18 Sep 2017 23:10:14 +0530 Message-Id: <1505756414-12857-2-git-send-email-siddhesh@sourceware.org> In-Reply-To: <1505756414-12857-1-git-send-email-siddhesh@sourceware.org> References: <1505756414-12857-1-git-send-email-siddhesh@sourceware.org> String benchmarks that store results as throughput rather than latencies will show positive improvements as negative. Add a flag to fix the output of compare_strings.py in such cases. * benchtests/scripts/compare_strings.py: New option -t. --- benchtests/scripts/compare_strings.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/benchtests/scripts/compare_strings.py b/benchtests/scripts/compare_strings.py index 65119ed..acb64b9 100755 --- a/benchtests/scripts/compare_strings.py +++ b/benchtests/scripts/compare_strings.py @@ -79,7 +79,7 @@ def draw_graph(f, v, ifuncs, results): pylab.savefig('%s-%s.png' % (f, v), bbox_inches='tight') -def process_results(results, attrs, base_func, graph): +def process_results(results, attrs, base_func, graph, throughput): """ Process results and print them Args: @@ -110,6 +110,8 @@ def process_results(results, attrs, base_func, graph): if i != base_index: base = res['timings'][base_index] diff = (base - t) * 100 / base + if throughput: + diff = -diff sys.stdout.write (' (%6.2f%%)' % diff) sys.stdout.write('\t') i = i + 1 @@ -132,7 +134,7 @@ def main(args): attrs = args.attributes.split(',') results = parse_file(args.input, args.schema) - process_results(results, attrs, base_func, args.graph) + process_results(results, attrs, base_func, args.graph, args.throughput) if __name__ == '__main__': @@ -152,6 +154,8 @@ if __name__ == '__main__': help='IFUNC variant to set as baseline.') parser.add_argument('-g', '--graph', action='store_true', help='Generate a graph from results.') + parser.add_argument('-t', '--throughput', action='store_true', + help='Treat results as throughput and not time.') args = parser.parse_args() main(args)