Why PC Stalls When AI Writes Code

I’m a freelance developer (well, kind of semi-professional, “Pro-am coder“, “Weekend and late nights warrior developer“) who loves to vibe code with AI. My go-to teammates are tools like Gemini and Claude, which I rely on for code generation and solving complex problems. It’s an amazing workflow—at least until the moment the AI drops a massive block of code into my browser.
Just last night, while working on a fairly ambitious project, I ran again into a strange slowdown. Whenever the AI generated a large chunk of code in Chrome, my fast, reliable PC suddenly felt like it was sinking in quicksand. The mouse lagged, everything stuttered, and my entire system seemed to grind to a crawl when I was deep into a session. I started calling it: The Mystery of the Stuttering Mouse.
My Hardware Should Be Enough
I assumed it had to be a resource bottleneck, but my rig is more than capable:
- CPU: Intel Core i7-9750H (6 cores)
- RAM: 32 GB high-speed memory
- Background load: just a few Docker containers and services
Task Manager showed no red flags. CPU, GPU, and memory usage all looked stable. No spikes, no obvious bottlenecks. I also knew these AI sessions weren’t using local CPU, GPU, or NPU for the heavy lifting—so what was really dragging everything down?
The True Culprit: Browser Main Thread Saturation
It wasn’t my hardware failing—it was Chrome choking. The slowdown came from a brutal overload on the browser’s main JavaScript thread, the single-threaded workhorse that handles rendering, input, and page updates.
The Chrome Task Manager revealed the real clue: my AI chat tab alone was chewing up over 1.1 GB of RAM.
Here’s what’s happening under the hood when the AI streams out big chunks of code:
- Rendering Overload: Each large code block sets off a heavy sequence—parsing thousands of tokens, applying syntax highlighting, inserting text, and recalculating layouts in real time. The renderer gets overwhelmed fast.
- Input De-Prioritization (a.k.a. Mouse Lag): With the main thread consumed by rendering, it stops giving priority to the OS input queue. Mouse and keyboard events are delayed, producing that sticky, dragging cursor effect.
- Memory Bloat: A long chat session builds a massive DOM full of text, formatting, and code. Each new streamed response forces rapid reprocessing of that structure, making updates increasingly expensive.
My Workflow Fixes
The solution wasn’t more hardware—it was smarter browser management.
- Isolate the AI: I now run AI chats in their own minimalist Chrome profile, with no extra tabs or heavy extensions. This keeps responsiveness high.
- Clear the History: If a conversation grows until it hits gigabyte-sized memory use, I start fresh. A clean slate keeps the DOM light and efficient.
- Segregate the Work: For heavy AI coding sessions, I work on a secondary machine that I can remote desktop into, dedicated exclusively to browser-based chat coding tasks.
If you’re a developer hitting weird slowdowns with AI tools, don’t blame your CPU or RAM. The real bottleneck is almost always the browser’s overwhelmed main thread. Keep your tabs lean, reset long chats, and respect the rendering overhead. Do that, and you’ll get back to smooth, uninterrupted vibe coding.
The search for the optimal coding assistant continues! Would love to know your thoughts!
Want More Updates? =>Subscribe to my JorgeTechBits newsletter