MCPcopy Index your code
hub / github.com/nodejs/node / Compare

Method Compare

deps/v8/tools/perf-compare.py:101–125  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

99 self.sigma_ = float(sigma)
100
101 def Compare(self, other):
102 if self.units_ != other.units_:
103 print ("Incompatible units: %s and %s" % (self.units_, other.units_))
104 sys.exit(1)
105
106 significant = False
107 notable = 0
108 percentage_string = ""
109 # compute notability and significance.
110 if self.units_ == "score":
111 compare_num = 100*self.result_/other.result_ - 100
112 else:
113 compare_num = 100*other.result_/self.result_ - 100
114 if abs(compare_num) > 0.1:
115 percentage_string = "%3.1f" % (compare_num)
116 z = Statistics.ComputeZ(other.result_, other.sigma_,
117 self.result_, self.count_)
118 p = Statistics.ComputeProbability(z)
119 if p < PROBABILITY_CONSIDERED_SIGNIFICANT:
120 significant = True
121 if compare_num >= PERCENT_CONSIDERED_SIGNIFICANT:
122 notable = 1
123 elif compare_num <= -PERCENT_CONSIDERED_SIGNIFICANT:
124 notable = -1
125 return ResultsDiff(significant, notable, percentage_string)
126
127 def result(self):
128 return self.result_

Callers 2

PrintComparisonMethod · 0.45
parse_compareMethod · 0.45

Calls 6

ResultsDiffClass · 0.85
ComputeZMethod · 0.80
ComputeProbabilityMethod · 0.80
printFunction · 0.70
absFunction · 0.50
exitMethod · 0.45

Tested by

no test coverage detected