Solve Google AI Studio freezing
Performance degradation in complex, single-page web applications like Google AI Studio is a known issue on Chromium-based browsers (Google Chrome, Microsoft Edge). Users may experience input lag and general unresponsiveness. This is often not a fault of the web application itself, but a consequence of how the browser renders page elements, specifically the scrollbar.
Technical Cause
The root cause of this lag is often tied to the browser's rendering process, specifically an event called "layout reflow" or "layout thrashing".
-
Classic Scrollbars: Traditional scrollbars occupy a dedicated space (the "gutter") on the side of the content. When content is added or removed dynamically—as is common in AI chat interfaces—the appearance or disappearance of this scrollbar can force the browser to recalculate the layout of the entire page. This process, known as reflow, is CPU-intensive. On a complex page with many elements, repeated reflows can lead to significant performance bottlenecks, causing the user interface to feel sluggish or "janky".
-
Overlay Scrollbars: In contrast, overlay scrollbars (referred to as "Fluent overlay scrollbars" in Edge) do not occupy a permanent gutter. Instead, they are rendered as a floating layer on top of the content and are often semi-transparent. They typically only appear during active scrolling. Because they don't alter the content area's width, they do not trigger the expensive layout reflow process when they appear or disappear, thus preventing performance degradation.
By forcing the browser to use overlay scrollbars, you can prevent these reflows and improve the application's responsiveness.
Solution
This fix requires enabling an experimental feature flag in your browser.
Google Chrome / Chromium
- Navigate to
chrome://flags/#overlay-scrollbarsin the address bar. - Locate the Overlay Scrollbars setting.
- Change its value from "Default" to Enabled.
- Click the Relaunch button to apply the change.
Microsoft Edge
- Navigate to
edge://flags/#Fluent overlay scrollbarsin the address bar. - Locate the Fluent overlay scrollbars setting.
- Change its value from "Default" to Enabled.
- Click the Restart button to apply the change.
After relaunching, the browser will use the more efficient overlay scrollbar type, which should resolve the observed lag in resource-intensive web applications.
I also recommend a greasyfork script of mine for beautifying the aistudio page: link
中文版
解决 Chromium 浏览器中的 UI 卡顿问题
在 Chromium 内核的浏览器(如 Google Chrome, Microsoft Edge)上,Google AI Studio 存在性能下降的已知问题。用户可能会遇到输入延迟和界面无响应的情况。这通常不是 Web 应用本身的问题,而是浏览器渲染页面元素(特别是滚动条)的方式所导致的。
