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

Method _generate_single_variant_report

ci/profile/parse_results.py:82–127  ·  view source on GitHub ↗

Generate report for single-variant tests

(self, target: str)

Source from the content-addressed store, hash-verified

80 return self._generate_single_variant_report(target)
81
82 def _generate_single_variant_report(self, target: str) -> str:
83 """Generate report for single-variant tests"""
84 stats = self.compute_statistics()
85
86 report = f"""
87# Performance Profile: {target}
88
89## Statistics ({stats["count"]} iterations)
90
91| Metric | Value |
92|--------|-------|
93| **Best** | {stats["best"]:.2f} ns/call |
94| **Median** | {stats["median"]:.2f} ns/call |
95| **Worst** | {stats["worst"]:.2f} ns/call |
96| **StdDev** | {stats["stdev"]:.2f} ns |
97| **Calls/sec** | {1e9 / stats["median"]:.0f} |
98
99## Interpretation
100
101- **Best case**: {stats["best"]:.2f} ns/call (ideal conditions)
102- **Typical**: {stats["median"]:.2f} ns/call (50th percentile)
103- **Variance**: {stats["stdev"]:.2f} ns (lower is better)
104
105## Recommendations
106
107"""
108
109 # Add recommendations based on performance
110 median_ns = stats["median"]
111 if median_ns > 1000:
112 report += "- **High latency** (>1μs): Consider algorithmic improvements\n"
113 elif median_ns > 100:
114 report += (
115 "- **Moderate latency** (100-1000ns): Look for micro-optimizations\n"
116 )
117 else:
118 report += (
119 "- **Low latency** (<100ns): Already well-optimized, focus elsewhere\n"
120 )
121
122 if stats["stdev"] / stats["median"] > 0.1:
123 report += (
124 "- **High variance**: Results inconsistent, may need more iterations\n"
125 )
126
127 return report
128
129 def _generate_comparison_report(self, target: str) -> str:
130 """Generate report for comparison tests with multiple variants"""

Callers 1

generate_reportMethod · 0.95

Calls 1

compute_statisticsMethod · 0.95

Tested by

no test coverage detected