# Performance Degradation in AI Studio Web UI with Large Context (300k+ Tokens) on Firefox

**URL:** <https://discuss.ai.google.dev/t/performance-degradation-in-ai-studio-web-ui-with-large-context-300k-tokens-on-firefox/114201>\
**Category:** Google AI Studio\
**Tags:** ai-studio, bug, performance\
**Created:** [January 6, 2026, 3:53am UTC](https://discuss.ai.google.dev/t/performance-degradation-in-ai-studio-web-ui-with-large-context-300k-tokens-on-firefox/114201 "2026-01-06T03:53:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![utm\_my](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/utm_my/32/80938_2.png) [@utm\_my](https://discuss.ai.google.dev/u/utm_my)\
**Post date:** [January 6, 2026, 3:53am UTC](https://discuss.ai.google.dev/t/performance-degradation-in-ai-studio-web-ui-with-large-context-300k-tokens-on-firefox/114201/1 "2026-01-06T03:53:21Z")

</div>

Hi Google AI Studio Team,

I am a heavy user of AI Studio and frequently work with very large context windows. I’ve noticed a significant performance issue that makes the tool difficult to use as the conversation grows.

**The Issue:** When a conversation reaches several hundred thousand tokens (approx. 200k - 500k+), the web interface’s loading performance drops drastically.

 ![image](https://d3qe71uytubmmx.cloudfront.net/original/3X/2/5/25c28ffd2661e524c78804ccfa0c7070445ef041.png)

---

<div class="post-metadata">

**Author:** ![Nireeksha\_K\_A](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/nireeksha_k_a/32/26043_2.png) [@Nireeksha\_K\_A](https://discuss.ai.google.dev/u/Nireeksha_K_A)\
**Post date:** [January 6, 2026, 8:26am UTC](https://discuss.ai.google.dev/t/performance-degradation-in-ai-studio-web-ui-with-large-context-300k-tokens-on-firefox/114201/3 "2026-01-06T08:26:56Z")

</div>

Hi @utm_my , Welcome to forum!!!

Thank you for reaching out. Could you please try using AI Studio in browsers like Chrome to check if the performance issue still occurs?

---

<div class="post-metadata">

**Author:** ![Ember](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/ember/32/35291_2.png) [@Ember](https://discuss.ai.google.dev/u/Ember)\
**Post date:** [January 6, 2026, 12:44pm UTC](https://discuss.ai.google.dev/t/performance-degradation-in-ai-studio-web-ui-with-large-context-300k-tokens-on-firefox/114201/5 "2026-01-06T12:44:36Z")

</div>

I use Opera GX - When I’m in a long session with the AI, after about 2-3MB of text in the context, it starts lagging really badly.

---

<div class="post-metadata">

**Author:** ![utm\_my](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/utm_my/32/80938_2.png) [@utm\_my](https://discuss.ai.google.dev/u/utm_my)\
**Post date:** [January 7, 2026, 12:14am UTC](https://discuss.ai.google.dev/t/performance-degradation-in-ai-studio-web-ui-with-large-context-300k-tokens-on-firefox/114201/7 "2026-01-07T00:14:18Z")

</div>

![tempFileForShare_20260106-234048](https://d3qe71uytubmmx.cloudfront.net/original/3X/4/1/41ba7e8dc9c508a912d448af9a64f99660f7d730.jpeg)

Hi，I am now seeing a critical error on Chrome (Samsung Internet Browser) when the conversation context is large.

**Token Counting Failure:** A persistent error message pops up: **“Failed to count tokens. Please try again.”** This appears to happen as the total token count reaches several hundred thousand.

---

<div class="post-metadata">

**Author:** ![C\_F](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/c_f/32/51283_2.png) [@C\_F](https://discuss.ai.google.dev/u/C_F)\
**Post date:** [January 7, 2026, 2:36am UTC](https://discuss.ai.google.dev/t/performance-degradation-in-ai-studio-web-ui-with-large-context-300k-tokens-on-firefox/114201/8 "2026-01-07T02:36:20Z")

</div>

\*\*Subject:\*\* Solved: Bypass the Firefox/Browser Lag with a Headless Script

"Hi @utm_my

I saw your screenshot—I’ve dealt with this exact ‘endless loading’ issue myself. You are absolutely right; once you hit that 200k–500k token range, the bottleneck isn’t the API or the model. It’s the browser (Firefox in your case, but Chrome does it too) struggling to render the Document Object Model (DOM) for millions of characters of history. The UI thread just locks up.

Since you are a heavy user, the most reliable fix is to decouple the \*\*computation\*\* from the \*\*rendering\*\*. I switched to using a lightweight local Python script for my heavy context sessions. It bypasses the web UI entirely, so there is zero lag even at 1M+ tokens because your machine doesn’t have to render the visual chat history.

Here is the basic script I use. You just need your API key from AI Studio. It prints the stream directly to your terminal:

```python
import google.generativeai as genai
import os

# Setup: Get your key from AI Studio
# os.environ["GOOGLE_API_KEY"] = "PASTE_YOUR_KEY_HERE"
genai.configure(api_key=os.environ["GOOGLE_API_KEY"])

# Model: 1.5 Pro is optimized for large context
model = genai.GenerativeModel('gemini-1.5-pro-latest')

def heavy_lifter_chat():
    chat = model.start_chat(history=[]) # History kept in RAM
    print("--- HEADLESS CONTEXT MODE ONLINE ---\nType 'quit' to exit.")
    while True:
        try:
            user_input = input("\nYOU: ")
            if user_input.lower() in ['quit', 'exit']: break
            # Stream response to avoid buffering waits
            response = chat.send_message(user_input, stream=True)
            print("\nGEMINI: ", end="")
            for chunk in response:
                print(chunk.text, end="")
            print("\n")
        except Exception as e:
            print(f"Error: {e}")

if __name__ == " __main__":
    heavy_lifter_chat()

```
