Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
tools.skpbench._benchresult.BenchResult Class Reference

Public Member Functions

def match (cls, text)
 
def __init__ (self, match)
 
def get_string (self, name)
 
def format (self, config_suffix=None)
 

Public Attributes

 accum
 
 median
 
 max
 
 min
 
 stddev
 
 samples
 
 sample_ms
 
 clock
 
 metric
 
 config
 
 bench
 

Static Public Attributes

string FLOAT_REGEX = '[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?'
 
 PATTERN
 

Detailed Description

Definition at line 12 of file _benchresult.py.

Constructor & Destructor Documentation

◆ __init__()

def tools.skpbench._benchresult.BenchResult.__init__ (   self,
  match 
)

Definition at line 42 of file _benchresult.py.

42 def __init__(self, match):
43 self.accum = float(match.group('accum'))
44 self.median = float(match.group('median'))
45 self.max = float(match.group('max'))
46 self.min = float(match.group('min'))
47 self.stddev = float(match.group('stddev')[:-1]) # Drop '%' sign.
48 self.samples = int(match.group('samples'))
49 self.sample_ms = int(match.group('sample_ms'))
50 self.clock = match.group('clock')
51 self.metric = match.group('metric')
52 self.config = match.group('config')
53 self.bench = match.group('bench')
54 self._match = match
55

Member Function Documentation

◆ format()

def tools.skpbench._benchresult.BenchResult.format (   self,
  config_suffix = None 
)

Definition at line 59 of file _benchresult.py.

59 def format(self, config_suffix=None):
60 if not config_suffix or config_suffix == '':
61 return self._match.group(0)
62 else:
63 values = list()
64 for name in ['accum', 'median', 'max', 'min', 'stddev',
65 'samples', 'sample_ms', 'clock', 'metric', 'config']:
66 values.append(self.get_string(name + '_pad'))
67 values.append(self.get_string(name))
68 values.append(config_suffix)
69 bench_pad = self.get_string('bench_pad')
70 values.append(bench_pad[min(len(config_suffix), len(bench_pad) - 1):])
71 values.append(self.get_string('bench'))
72 return ''.join(values)
uint32_t uint32_t * format
static float min(float r, float g, float b)
Definition: hsl.cpp:48
static SkString join(const CommandLineFlags::StringArray &)
Definition: skpbench.cpp:741

◆ get_string()

def tools.skpbench._benchresult.BenchResult.get_string (   self,
  name 
)

Definition at line 56 of file _benchresult.py.

56 def get_string(self, name):
57 return self._match.group(name)
58
static const char * get_string(FcPattern *pattern, const char field[], int index=0)

◆ match()

def tools.skpbench._benchresult.BenchResult.match (   cls,
  text 
)

Definition at line 38 of file _benchresult.py.

38 def match(cls, text):
39 match = cls.PATTERN.search(text)
40 return cls(match) if match else None
41
def match(bench, filt)
Definition: benchmark.py:23

Member Data Documentation

◆ accum

tools.skpbench._benchresult.BenchResult.accum

Definition at line 43 of file _benchresult.py.

◆ bench

tools.skpbench._benchresult.BenchResult.bench

Definition at line 53 of file _benchresult.py.

◆ clock

tools.skpbench._benchresult.BenchResult.clock

Definition at line 50 of file _benchresult.py.

◆ config

tools.skpbench._benchresult.BenchResult.config

Definition at line 52 of file _benchresult.py.

◆ FLOAT_REGEX

string tools.skpbench._benchresult.BenchResult.FLOAT_REGEX = '[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?'
static

Definition at line 13 of file _benchresult.py.

◆ max

tools.skpbench._benchresult.BenchResult.max

Definition at line 45 of file _benchresult.py.

◆ median

tools.skpbench._benchresult.BenchResult.median

Definition at line 44 of file _benchresult.py.

◆ metric

tools.skpbench._benchresult.BenchResult.metric

Definition at line 51 of file _benchresult.py.

◆ min

tools.skpbench._benchresult.BenchResult.min

Definition at line 46 of file _benchresult.py.

◆ PATTERN

tools.skpbench._benchresult.BenchResult.PATTERN
static
Initial value:
= re.compile('^(?P<accum_pad> *)'
'(?P<accum>' + FLOAT_REGEX + ')'
'(?P<median_pad> +)'
'(?P<median>' + FLOAT_REGEX + ')'
'(?P<max_pad> +)'
'(?P<max>' + FLOAT_REGEX + ')'
'(?P<min_pad> +)'
'(?P<min>' + FLOAT_REGEX + ')'
'(?P<stddev_pad> +)'
'(?P<stddev>' + FLOAT_REGEX + '%)'
'(?P<samples_pad> +)'
'(?P<samples>\d+)'
'(?P<sample_ms_pad> +)'
'(?P<sample_ms>\d+)'
'(?P<clock_pad> +)'
'(?P<clock>[cg]pu)'
'(?P<metric_pad> +)'
'(?P<metric>ms|fps)'
'(?P<config_pad> +)'
'(?P<config>[^\s]+)'
'(?P<bench_pad> +)'
'(?P<bench>[^\s]+)$')

Definition at line 14 of file _benchresult.py.

◆ sample_ms

tools.skpbench._benchresult.BenchResult.sample_ms

Definition at line 49 of file _benchresult.py.

◆ samples

tools.skpbench._benchresult.BenchResult.samples

Definition at line 48 of file _benchresult.py.

◆ stddev

tools.skpbench._benchresult.BenchResult.stddev

Definition at line 47 of file _benchresult.py.


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