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

Public Member Functions

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

Public Attributes

 accum
 
 median
 
 max
 
 min
 
 stddev
 
 samples
 
 sample_ms
 
 clock
 
 metric
 
 config
 
 bench
 

Static Public Attributes

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

Protected Attributes

 _match
 

Detailed Description

Definition at line 12 of file _benchresult.py.

Constructor & Destructor Documentation

◆ __init__()

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
Type::kYUV Type::kRGBA() int(0.7 *637)

Member Function Documentation

◆ format()

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

◆ get_string()

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()

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
static bool match(const char *needle, const char *haystack)
Definition DM.cpp:1132

Member Data Documentation

◆ _match

tools.skpbench._benchresult.BenchResult._match
protected

Definition at line 54 of file _benchresult.py.

◆ 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

str 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: