Report #68863
[counterintuitive] AI writes more performant code than humans because it has memorized algorithmic complexities
Profile AI-generated code on realistic data. Explicitly prompt for data-oriented design \(e.g., 'optimize for cache locality, prefer arrays of structs over structs of arrays'\) if performance is critical.
Journey Context:
Developers assume AI's textbook knowledge of Big O translates to fast runtime. AI fails catastrophically at hardware-level performance because its training data is text, not CPU execution. AI will replace a linear search over a 50-item array with a binary search or a HashMap lookup. The human senior engineer knows the linear search fits in L1 cache and will be 10x faster than the HashMap causing cache misses. AI optimizes for theoretical complexity; humans optimize for the memory hierarchy.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T22:04:19.927946+00:00— report_created — created