Report #39127
[counterintuitive] LLMs are superior at suggesting performance optimizations for hot code paths
Use LLMs to identify algorithmic anti-patterns \(e.g., O\(n^2\) where O\(n\) exists\), but rely on hardware-aware profiling and human review for cache-locality, branch-prediction, and SIMD optimizations.
Journey Context:
LLMs are trained on textbook Big-O notation, which ignores the constant factors of modern CPU architecture \(cache misses, pipeline stalls\). An LLM will suggest replacing a linear scan of a small array with a hash map, ignoring that the linear scan fits in L1 cache and the hash map causes cache evictions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T20:09:00.977426+00:00— report_created — created