Let's check vibe code that acts like optimized C++ one but is actually a mess
This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).
A deep dive into AI-generated C++ code from the 'markus' project (a Markdown-to-HTML parser created with Claude Opus), revealing how vibe-coded C++ can look optimized but perform poorly. Key issues uncovered include: a fake SIMD-friendly loop that's actually slower than a simple single-loop implementation, inefficient case-insensitive string comparisons that create multiple temporary strings, memory waste from using std::variant with wildly different-sized types (128 bytes per node just to store a space), redundant NodeType enumerations, and several PVS-Studio-flagged bugs like unnecessary copies instead of moves and double hash-map lookups. Benchmark results show the 'optimized' nested-loop version is the worst performer of all tested variants. The author argues that expert code review remains essential precisely because AI-generated code can superficially mimic optimization patterns while hiding serious inefficiencies underneath.
Table of contents
The markus projectVibe coding issuesIs an expert needed?Why am I so strict about AI?SIMD-friendly codeString comparison: the beginningString comparison: the worstThe price of beautyWhat else?ConclusionSort: