C++
Read post

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.

    #c++#code-review#vibe-coding
Apr 21•28m read time•From pvs-studio.com
Post cover image
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?Conclusion
148 Impressions
C++'s image
C++

ISO C++ is the official website for the C++ programming language standardization committee, providin...

571 Followers

•

493 Upvotes

andreykarpov's user avatar
Andrey Karpov
@andreykarpov
Joined Jun 28. 2023
160

Andrey has been dealing with static code analysis and software quality for more than 15 years.

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard