1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4640],{832:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>l});var i=s(7876),r=s(8230),n=s.n(r),a=s(5543);let o={slug:"/articles/ai-coding-performance-bugs",title:"Why AI Coding Assistants Miss Deep Performance Bugs â Verificate",h1:"Why AI coding assistants miss deep performance bugs â and how to catch them anyway",description:"N+1 query storms, scalability cliffs, blocking calls on hot paths: the bug classes AI assistants reliably write and reliably fail to see. What deep performance review requires, and how to get it inside Claude Code, Cursor and Windsurf.",datePublished:"2026-07-27",readMinutes:7,faq:[{q:"Why do AI assistants write N+1 bugs so often?",a:"Because the N+1 shape â loop over items, call an API or query per item â is locally correct and extremely common in training data. The defect only exists at the interaction of loop size, network latency and rate limits, none of which are visible in the snippet the model is optimising to look right."},{q:"Won't tests catch performance bugs?",a:"Rarely. Unit tests run with N=3 fixtures and mocked I/O, which is precisely the configuration where an N+1 or a blocking call is invisible. Performance defects need review that reasons about production scale â item counts, roundtrip latency, rate limits, thread pools â before the code merges."},{q:"Can a review gate really quantify a performance bug?",a:"Yes, when it reasons from the code's structure: 100 items \xd7 1 synchronous roundtrip â 100 roundtrips â 10â20 s on typical API latency, on a blocking worker thread, against a provider limit of 100 req/s. That arithmetic is exactly what a validation gate can produce in seconds, per change."}]};function l(){return(0,i.jsxs)(a.m7,{meta:o,children:[(0,i.jsxs)(a.P,{children:["Ask engineers what they still don't trust AI coding with and the answers cluster tightly: deep performance work, scalability, the failure modes you only meet at 3am. The scepticism is earned â but the usual conclusion (âso a human must review everythingâ) doesn't scale at AI generation speed. It's worth being precise about",(0,i.jsx)(a.OH,{children:" why"})," assistants miss these bugs, because the why points at the fix."]}),(0,i.jsx)(a.H2,{children:"The bug the assistant can't see in its own diff"}),(0,i.jsx)(a.P,{children:"Here's the shape, reduced to its essence â twelve plausible lines:"}),(0,i.jsx)(a.Cy,{label:"looks fine in a diff",code:"async function applyRefunds(orderIds) {\n const results = [];\n for (const id of orderIds) {\n const order = await api.getOrder(id); // roundtrip per item\n const refund = await api.refund(order); // second roundtrip per item\n results.push(refund);\n }\n return results;\n}"}),(0,i.jsxs)(a.P,{children:["It passes tests (fixtures have three orders). It reads fine (idiomatic async/await). In production with 100 orders it's ",(0,i.jsx)(a.OH,{children:"200 sequential roundtrips â tens of seconds on a blocking path â and it trips the payment provider's rate limit"})," partway through a batch of refunds, leaving money in an inconsistent state. When we run this class of snippet through our own gate it comes back ",(0,i.jsx)(a.OH,{children:"REJECTED â 30.8/100"}),", with the latency arithmetic spelled out. The verbatim verdict is on the"," ",(0,i.jsx)(n(),{href:"/gate",className:"text-[#8CCB43] hover:underline",children:"Gate page"}),"."]}),(0,i.jsx)(a.H2,{children:"Why generation can't self-check this"}),(0,i.jsx)(a.UL,{items:[(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.OH,{children:"The defect isn't in the tokens."})," Every line is individually correct. The bug lives in the product of loop size \xd7 latency \xd7 rate limit â quantities that appear nowhere in the code the model is scoring itself on."]}),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.OH,{children:"Training data rewards the shape."})," Loop-and-call is the most common pattern for this task online. Fluency and correctness diverge exactly here."]}),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.OH,{children:"Self-review inherits self-blindness."})," Asking the generator to review its own output re-runs the distribution that produced the bug. It usually says the code looks good, because by its lights it does."]})]}),(0,i.jsx)(a.H2,{children:"What deep review actually requires"}),(0,i.jsxs)(a.P,{children:["Catching this class of defect requires review that is ",(0,i.jsx)(a.OH,{children:"independent of the generator"})," and structured around production quantities, not code aesthetics:"]}),(0,i.jsx)(a.UL,{items:[(0,i.jsxs)(i.Fragment,{children:["Complexity on the ",(0,i.jsx)(a.OH,{children:"I/O path"}),", not just big-O on CPU: roundtrips per request, per item, per retry."]}),(0,i.jsx)(i.Fragment,{children:"Concrete arithmetic against realistic scale â what does N=100, N=10,000 do to latency, memory, connection pools?"}),(0,i.jsx)(i.Fragment,{children:"Rate limits and quotas of every external service on the path, checked against the worst-case call pattern."}),(0,i.jsx)(i.Fragment,{children:"Blocking behaviour: what thread or event loop does this occupy, and for how long?"}),(0,i.jsx)(i.Fragment,{children:"Failure-mode review to a published standard â ISO/IEC 25010 reliability and performance-efficiency characteristics â so the bar is stable across changes and models."})]}),(0,i.jsxs)(a.Pq,{children:["None of this is beyond automated review â it's beyond ",(0,i.jsx)("em",{children:"self"}),"-review. An external gate that receives the diff, reasons about scale, and returns severity-ranked findings with the math catches the N+1 in seconds. The same gate has veto power over the reality failures (invented APIs, faked outcomes, mocks in the wire path) before performance review even begins."]}),(0,i.jsx)(a.H2,{children:"Wiring it into the loop"}),(0,i.jsxs)(a.P,{children:["The place to run deep review is inside the assistant's own loop, via MCP: the assistant calls"," ",(0,i.jsx)("code",{className:"font-mono text-[13px] text-[#8CCB43]",children:"val
1idate_ai_output"})," before presenting work,"," ",(0,i.jsx)("code",{className:"font-mono text-[13px] text-[#8CCB43]",children:"analyze_code"})," for an on-demand deep pass, and fixes findings while the context is hot. Setup is a one-block config in Claude Code, Cursor or Windsurf â the step-by-step is in"," ",(0,i.jsx)(n(),{href:"/articles/claude-code-review-mcp-server",className:"text-[#8CCB43] hover:underline",children:"our setup guide"}),"."]}),(0,i.jsx)(a.H2,{children:"The standard to hold"}),(0,i.jsxs)(a.P,{children:["âAI can't do deep performance workâ is half right: ",(0,i.jsx)(a.OH,{children:"generation"})," can't, reliably. Generation plus an independent, veto-empowered review that does the production arithmetic is a different system â one where the bug above never survives to a pull request, whichever model wrote it."]})]})}},4968:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/articles/ai-coding-performance-bugs",function(){return s(832)}])},5543:(e,t,s)=>{"use strict";s.d(t,{Cy:()=>f,H2:()=>u,OH:()=>m,P:()=>x,Pq:()=>g,UL:()=>p,m7:()=>w});var i=s(7876),r=s(8230),n=s.n(r),a=s(8419),o=s(6075),l=s(6887),c=s(1298),d=s(8558),h=s(8300);function u(e){let{children:t}=e;return(0,i.jsx)("h2",{className:"mt-12 text-2xl md:text-[28px] font-bold text-white tracking-tight",children:t})}function x(e){let{children:t}=e;return(0,i.jsx)("p",{className:"mt-5 text-[15.5px] text-white/60 leading-relaxed",children:t})}function m(e){let{children:t}=e;return(0,i.jsx)("strong",{className:"text-white font-semibold",children:t})}function p(e){let{items:t}=e;return(0,i.jsx)("ul",{className:"mt-5 space-y-2.5",children:t.map((e,t)=>(0,i.jsxs)("li",{className:"flex gap-3 text-[15.5px] text-white/60 leading-relaxed",children:[(0,i.jsx)("span",{className:"mt-[9px] w-1.5 h-1.5 rounded-full bg-[#8CCB43] shrink-0"}),(0,i.jsx)("span",{children:e})]},t))})}function f(e){let{label:t,code:s}=e;return(0,i.jsxs)("div",{className:"mt-6 rounded-2xl border border-white/[0.08] bg-[#0C0F0A] overflow-hidden",children:[(0,i.jsx)("div",{className:"px-5 py-2.5 border-b border-white/[0.06] font-mono text-xs text-white/45",children:t}),(0,i.jsx)("pre",{className:"px-5 py-4 overflow-x-auto text-[13px] leading-relaxed font-mono text-white/80",children:(0,i.jsx)("code",{children:s})})]})}function g(e){let{children:t}=e;return(0,i.jsx)("div",{className:"mt-6 rounded-2xl border border-[#2C3D1B] bg-[#12190C] px-6 py-5 text-[15px] text-white/70 leading-relaxed",children:t})}function w(e){var t,s,r,u,x;let{meta:m,children:p}=e,f=[{"@context":"https://schema.org","@type":null!=(x=m.type)?x:"TechArticle",headline:m.h1,description:m.description,url:"".concat(h.W6).concat(m.slug),datePublished:m.datePublished,dateModified:m.datePublished,author:m.author?{"@type":"Person",name:m.author.name,...m.author.url?{url:m.author.url}:{},worksFor:{"@type":"Organization",name:"Verificate Pty Ltd",url:h.W6}}:{"@type":"Organization",name:"Verificate Pty Ltd",url:h.W6},publisher:{"@type":"Organization",name:"Verificate Pty Ltd",url:h.W6},mainEntityOfPage:"".concat(h.W6).concat(m.slug),...(null==(r=m.keywords)?void 0:r.length)?{keywords:m.keywords.join(", ")}:{},...(null==(u=m.citation)?void 0:u.length)?{citation:m.citation.map(e=>({"@type":"CreativeWork",name:e.name,url:e.url})),isBasedOn:m.citation.map(e=>e.url)}:{}}];return(null==(t=m.faq)?void 0:t.length)&&f.push((0,h.P$)(m.faq)),(0,i.jsxs)("div",{className:"bg-[#080A08] text-white/85 min-h-screen antialiased",children:[(0,i.jsx)(d.A,{title:m.title,path:m.slug,description:m.description,image:m.image,type:"article",jsonLd:f}),(0,i.jsx)(c.Nv,{}),(0,i.jsxs)("main",{id:"main-content",children:[(0,i.jsx)(c.wn,{className:"pt-28 sm:pt-36 pb-4",children:(0,i.jsxs)("div",{className:"max-w-3xl",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3 text-white/40 font-mono text-xs",children:[(0,i.jsx)(n(),{href:"/articles",className:"text-[#8CCB43] hover:underline",children:"Articles"}),(0,i.jsx)("span",{children:"\xb7"}),(0,i.jsx)(n(),{href:"/news",className:"hover:text-[#8CCB43] hover:underline",children:"News & press"}),(0,i.jsx)("span",{children:"\xb7"}),(0,i.jsx)("span",{children:new Date(m.datePublished).toLocaleDateString("en-AU",{year:"numeric",month:"short",day:"numeric"})}),(0,i.jsx)("span",{children:"\xb7"}),(0,i.jsxs)("span",{children:[m.readMinutes," min read"]})]}),(0,i.jsx)("h1",{className:"mt-5 text-3xl sm:text-4xl md:text-[44px] font-bold tracking-tight text-white leading-tight",children:m.h1})]})}),(0,i.jsx)(c.wn,{className:"pb-10",children:(0,i.jsx)("article",{className:"max-w-3xl",children:p})}),(null==(s=m.faq)?void 0:s.length)?(0,i.jsx)(c.wn,{className:"py-10 border-t border-white/[0.06]",children:(0,i.jsxs)("div",{className:"max-w-3xl",children:[(0,i.jsx)(c.YZ,{children:"FAQ"}),(0,i.jsx)("div",{className:"mt-6 space-y-6",children:m.faq.map(e=>(0,i.jsxs)("div",{children:[(0,i.jsx)("h3",{className:"font-bold text-white",children:e.q}),(0,i.jsx)("p",{className:"mt-2 text-[15px] text-white/55 leading-relaxed",children:e.a})]},e.q))})]})}):null,"cti"===m.cta?(0,i.jsx)(c.wn,{className:"py-16",children:(0,i.jsxs)("div",{className:"rounded-3xl border border-[#2C3D1B] bg-gradient-to-b from-[#12190C] to-[#0B0F0A] px-8 md:px-14 py-12 text-center",children:[(0,i.jsx)("h2",{className:"text-2xl md:text-3xl font-bold text-white tracking-tight",children:"Bring a question your AI needs to get right."}),(0,i.jsx)("p",{className:"mt-4 text-white/60 max-w-2xl mx-auto",children:"Compile-Time Inference prepares your records before questions arrive, so supported answers and decisions can be checked against their evidence. Start with the questions where a wrong answer costs the most."}),(0,i.jsxs)("div",{className:"mt-8 flex flex-wrap justify-center gap-4",children:[(0,i.jsxs)(n(),{href:"/compile-time-inference",className:"inline-flex items-center gap-2 px-5 py-3 rounded-lg bg-[#8CCB43] hover:bg-[#7cbb37] text-[#0A0D0A] font-semibold transition-colors",children:["See Compile-Time Inference ",(0,i.jsx)(a.A,{className:"w-4 h-4"})]}),(0,i.jsxs)("a",{href:"/Verificate_Compile-Time_Inference_Brochure.pdf",download:"Verificate_Compile-Time_Inference_Brochure.pdf",className:"inline-flex items-center gap-2 px-5 py-3 rounded-lg border border-white/15 hover:border-[#8CCB43]/50 text-white font-semibold transition-colors",children:[(0,i.jsx)(o.A,{className:"w-4 h-4"})," Download the brochure (PDF)"]}),(0,i.jsxs)(n(),{href:"/contact?interest=compile-time-inference",className:"inline-flex items-center gap-2 px-5 py-3 rounded-lg border border-white/15 hover:border-[#8CCB43]/50 text-white font-semibold transition-colors",children:["Talk to us ",(0,i.jsx)(a.A,{className:"w-4 h-4"})]})]})]})}):(0,i.jsx)(c.wn,{className:"py-16",children:(0,i.jsxs)("div",{className:"rounded-3xl border border-[#2C3D1B] bg-gradient-to-b from-[#12190C] to-[#0B0F0A] px-8 md:px-14 py-12 text-center",children:[(0,i.jsx)("h2",{className:"text-2xl md:text-3xl font-bold text-white tracking-tight",children:"Put a real gate on your AI output."}),(0,i.jsx)("p",{className:"mt-4 text-white/60 max-w-2xl mx-auto",children:"Verificate Gate (available via MCP) runs deterministic checks plus an engineering-quality review on every AI output â in Claude Code, Cursor, Windsurf or any MCP client. 30-day free trial, no card required."}),(0,i.jsxs)("div",{className:"mt-8 flex flex-wrap justify-center gap-4",children:[(0,i.jsxs)(n(),{href:"/auth/signup",className:"inline-flex items-center gap-2 px-5 py-3 rounded-lg bg-[#8CCB43] hover:bg-[#7cbb37] text-[#0A0D0A] font-semibold transition-colors",children:[(0,i.jsx)(l.A,{className:"w-4 h-4"})," Start 30-day free trial"]}),(0,i.jsxs)(n(),{href:"/gate",className:"inline-flex items-center gap-2 px-5 py-3 rounded-lg border border-white/15 hover:border-[#8CCB43]/50 text-white font-semibold transition-colors",children:["See how the Gate works ",(0,i.jsx)(a.A,{className:"w-4 h-4"})]})]})]})})]})]})}}},e=>{e.O(0,[8096,8799,636,8792],()=>e(e.s=4968)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.