MCPcopy Create free account
hub / github.com/FastLED/FastLED / compute_statistics

Method compute_statistics

ci/profile/parse_results.py:46–70  ·  view source on GitHub ↗

Compute best/median/worst/stdev for a set of results

(
        self, results: list[ProfileResult] | None = None
    )

Source from the content-addressed store, hash-verified

44 self.variants[result.variant].append(result)
45
46 def compute_statistics(
47 self, results: list[ProfileResult] | None = None
48 ) -> dict[str, float]:
49 """Compute best/median/worst/stdev for a set of results"""
50 if results is None:
51 results = self.results
52
53 if not results:
54 return {
55 "best": 0,
56 "median": 0,
57 "worst": 0,
58 "stdev": 0,
59 "count": 0,
60 }
61
62 ns_per_call = [r.ns_per_call for r in results]
63
64 return {
65 "best": min(ns_per_call),
66 "median": statistics.median(ns_per_call),
67 "worst": max(ns_per_call),
68 "stdev": statistics.stdev(ns_per_call) if len(ns_per_call) > 1 else 0,
69 "count": len(ns_per_call),
70 }
71
72 def generate_report(self) -> str:
73 """Generate markdown report for AI consumption"""

Callers 3

export_for_aiMethod · 0.95

Calls 1

maxFunction · 0.85

Tested by

no test coverage detected