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

Method export_for_ai

ci/profile/parse_results.py:185–222  ·  view source on GitHub ↗

Export structured data for AI consumption

(self)

Source from the content-addressed store, hash-verified

183 return report
184
185 def export_for_ai(self) -> dict[str, Any]:
186 """Export structured data for AI consumption"""
187 target = self.results[0].target if self.results else "unknown"
188
189 # Handle comparison tests
190 if len(self.variants) > 1:
191 variant_stats: dict[str, Any] = {}
192 for variant_name, variant_results in self.variants.items():
193 variant_stats[variant_name] = self.compute_statistics(variant_results)
194
195 # Compute speedup
196 sorted_variants = sorted(
197 variant_stats.items(), key=lambda x: x[1]["median"]
198 )
199 fastest = sorted_variants[0]
200 slowest = sorted_variants[-1]
201 speedup = slowest[1]["median"] / fastest[1]["median"]
202
203 return {
204 "target": target,
205 "comparison": True,
206 "variants": variant_stats,
207 "fastest": fastest[0],
208 "slowest": slowest[0],
209 "speedup": round(speedup, 2),
210 }
211 else:
212 # Single variant
213 stats = self.compute_statistics()
214 return {
215 "target": target,
216 "comparison": False,
217 "statistics": stats,
218 "raw_results": [
219 {"ns_per_call": r.ns_per_call, "calls_per_sec": r.calls_per_sec}
220 for r in self.results
221 ],
222 }
223
224
225def main() -> int:

Callers 1

mainFunction · 0.95

Calls 3

compute_statisticsMethod · 0.95
roundFunction · 0.85
itemsMethod · 0.80

Tested by

no test coverage detected