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

Side by Side Diff: components/tracing/test/tracing_virtual_tradeoff.py

Issue 2656303003: Test virtual interface [NOT FOR REVIEW] (Closed)
Patch Set: results Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « components/tracing/test/tracing_interface_simulator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright (c) 2017 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 import fileinput
7
8
9 def main():
10 perf_virtual = []
11 perf_direct = []
12
13 for line in fileinput.input():
14 if 'virtual_calls: events= ' in line:
15 measure = int(line.split('virtual_calls: events= ')[1].split(' ms')[0])
16 perf_virtual.append(measure)
17 if 'direct_calls: events= ' in line:
18 measure = int(line.split('direct_calls: events= ')[1].split(' ms')[0])
19 perf_direct.append(measure)
20
21 perf_virtual.sort()
22 perf_direct.sort()
23 median_virtual = perf_virtual[len(perf_virtual) / 2]
24 median_direct = perf_direct[len(perf_direct) / 2]
25 tradeoff = float(median_virtual) / float(median_direct) - 1.0
26
27 print('Median virtual: {0} ms'.format(median_virtual))
28 print('Median direct: {0} ms'.format(median_direct))
29 print('Tradeoff: {0:.2f}%'.format(tradeoff * 100))
30
31
32 if __name__ == '__main__':
33 main()
OLDNEW
« 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