Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
tools.skpbench.sheet.Parser Class Reference

Public Member Functions

def __init__ (self)
 
def parse_file (self, infile)
 
def print_csv (self, outfile=sys.stdout)
 

Public Attributes

 sheet_qualifiers
 
 config_qualifiers
 
 fullconfigs
 
 rows
 
 cols
 

Detailed Description

Definition at line 66 of file sheet.py.

Constructor & Destructor Documentation

◆ __init__()

def tools.skpbench.sheet.Parser.__init__ (   self)

Definition at line 67 of file sheet.py.

67 def __init__(self):
68 self.sheet_qualifiers = {x:None for x in RESULT_QUALIFIERS}
69 self.config_qualifiers = set()
70 self.fullconfigs = list() # use list to preserve the order.
71 self.rows = defaultdict(dict)
72 self.cols = defaultdict(dict)
73
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not set
Definition: switches.h:76

Member Function Documentation

◆ parse_file()

def tools.skpbench.sheet.Parser.parse_file (   self,
  infile 
)

Definition at line 74 of file sheet.py.

74 def parse_file(self, infile):
75 for line in infile:
76 match = BenchResult.match(line)
77 if not match:
78 continue
79
80 fullconfig = FullConfig(*(match.get_string(x)
81 for x in FullConfig._fields))
82 if not fullconfig in self.fullconfigs:
83 self.fullconfigs.append(fullconfig)
84
85 for qualifier, value in self.sheet_qualifiers.items():
86 if value is None:
87 self.sheet_qualifiers[qualifier] = match.get_string(qualifier)
88 elif value != match.get_string(qualifier):
89 del self.sheet_qualifiers[qualifier]
90 self.config_qualifiers.add(qualifier)
91
92 self.rows[match.bench][fullconfig] = match.get_string(FLAGS.result)
93 self.cols[fullconfig][match.bench] = getattr(match, FLAGS.result)
94
static void append(char **dst, size_t *count, const char *src, size_t n)
Definition: editor.cpp:211

◆ print_csv()

def tools.skpbench.sheet.Parser.print_csv (   self,
  outfile = sys.stdout 
)

Definition at line 95 of file sheet.py.

95 def print_csv(self, outfile=sys.stdout):
96 # Write the title.
97 print(get_qualified_name(FLAGS.result, self.sheet_qualifiers), file=outfile)
98
99 # Write the header.
100 outfile.write('bench,')
101 for fullconfig in self.fullconfigs:
102 outfile.write('%s,' % fullconfig.qualified_name(self.config_qualifiers))
103 outfile.write('\n')
104
105 # Write the rows.
106 for bench, row in self.rows.iteritems():
107 outfile.write('%s,' % bench)
108 for fullconfig in self.fullconfigs:
109 if fullconfig in row:
110 outfile.write('%s,' % row[fullconfig])
111 elif FLAGS.force:
112 outfile.write('NULL,')
113 else:
114 raise ValueError("%s: missing value for %s. (use --force to ignore)" %
115 (bench,
116 fullconfig.qualified_name(self.config_qualifiers)))
117 outfile.write('\n')
118
119 # Add simple, literal averages.
120 if len(self.rows) > 1:
121 outfile.write('\n')
122 self._print_computed_row('MEAN',
123 lambda col: reduce(operator.add, col.values()) / len(col),
124 outfile=outfile)
125 self._print_computed_row('GEOMEAN',
126 lambda col: reduce(operator.mul, col.values()) ** (1.0 / len(col)),
127 outfile=outfile)
128
def print(*args, **kwargs)
Definition: run_tests.py:49
def get_qualified_name(name, qualifiers)
Definition: sheet.py:59

Member Data Documentation

◆ cols

tools.skpbench.sheet.Parser.cols

Definition at line 72 of file sheet.py.

◆ config_qualifiers

tools.skpbench.sheet.Parser.config_qualifiers

Definition at line 69 of file sheet.py.

◆ fullconfigs

tools.skpbench.sheet.Parser.fullconfigs

Definition at line 70 of file sheet.py.

◆ rows

tools.skpbench.sheet.Parser.rows

Definition at line 71 of file sheet.py.

◆ sheet_qualifiers

tools.skpbench.sheet.Parser.sheet_qualifiers

Definition at line 68 of file sheet.py.


The documentation for this class was generated from the following file: