Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1049)

Unified Diff: components/tracing/test/tracing_virtual_tradeoff.py

Issue 2656303003: Test virtual interface [NOT FOR REVIEW] (Closed)
Patch Set: results Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/tracing/test/tracing_interface_simulator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/tracing/test/tracing_virtual_tradeoff.py
diff --git a/components/tracing/test/tracing_virtual_tradeoff.py b/components/tracing/test/tracing_virtual_tradeoff.py
new file mode 100755
index 0000000000000000000000000000000000000000..3df9d1ceb76b8d2ba374d5399baac53338d50ffa
--- /dev/null
+++ b/components/tracing/test/tracing_virtual_tradeoff.py
@@ -0,0 +1,33 @@
+#!/usr/bin/env python
+# Copyright (c) 2017 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import fileinput
+
+
+def main():
+ perf_virtual = []
+ perf_direct = []
+
+ for line in fileinput.input():
+ if 'virtual_calls: events= ' in line:
+ measure = int(line.split('virtual_calls: events= ')[1].split(' ms')[0])
+ perf_virtual.append(measure)
+ if 'direct_calls: events= ' in line:
+ measure = int(line.split('direct_calls: events= ')[1].split(' ms')[0])
+ perf_direct.append(measure)
+
+ perf_virtual.sort()
+ perf_direct.sort()
+ median_virtual = perf_virtual[len(perf_virtual) / 2]
+ median_direct = perf_direct[len(perf_direct) / 2]
+ tradeoff = float(median_virtual) / float(median_direct) - 1.0
+
+ print('Median virtual: {0} ms'.format(median_virtual))
+ print('Median direct: {0} ms'.format(median_direct))
+ print('Tradeoff: {0:.2f}%'.format(tradeoff * 100))
+
+
+if __name__ == '__main__':
+ main()
« no previous file with comments | « components/tracing/test/tracing_interface_simulator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698