Skip to content

Long git diffs create lag in Codex App #13809

Closed as not planned
Closed as not planned

Description

@jmoran650

What version of the Codex App are you using (From “About Codex” dialog)?

Version 26.305.950 (863)

What subscription do you have?

Pro

What platform is your computer?

Darwin 25.2.0 arm64 arm

What issue are you seeing?

If a thread has a huge git diff staged it causes the app to become extremely laggy. I at one point had +200,000 showing in the toggle git diff panel button and it caused the app to use a huge amount of memory and become extremely slow. Lag remains whether the thread with the huge diff is open or not. Committing changes and pushing fixed the lag.

What steps can reproduce the bug?

  1. Have a huge git diff build up in a thread.

What is the expected behavior?

No response

Additional information

No response

Activity

  1. added
    appIssues related to the Codex desktop app
    on Mar 6, 2026
  2. changed the title [-]Long git diffs create lag[/-] [+]Long git diffs create lag in Codex App[/+] on Mar 6, 2026
  3. github-actions commented on Mar 6, 2026

    @github-actions
    Contributor
  4. Fuiste commented on Apr 14, 2026

    @Fuiste

    Adding data from #14469, since it was marked duplicate here.

    I think, “large diff makes the app laggy” is real, and some investigation points to there being more going on. I did a local pass on latest main (b3ae531b) and found a separate app-server cost on thread switching / thread hydration that’s big enough to cause visible freezes on its own.

    What I measured locally against the checked-out codex-app-server over stdio JSON-RPC:

    • direct SQLite thread list: ~0.8–1.2 ms
    • thread/list(limit=50): ~138–155 ms
    • thread/read(includeTurns=false): ~6–13 ms
    • thread/read(includeTurns=true): ~353–834 ms depending on thread size
    • thread/resume: first call ~1660–1960 ms, then ~350–860 ms

    The interesting split is that the cheap metadata path is fast, but full transcript hydration is not. That lines up pretty well with the app-server paths in latest main, and also with the production timings already captured in #14469.

    My current thoughts are:

    • big diffs are one trigger for lag
    • there’s also a broader “large thread / thread resume / full history hydration” performance problem
    • thread/list also seems slower than it needs to be for sidebar refreshes

    Related reports that seem to be talking about the same family of issues:

    From my poking around, the two smallest promising fixes look like:

    • make thread/list DB-first when SQLite is healthy
    • avoid blocking thread selection on full thread/resume hydration
  5. added
    code-reviewIssues relating to code reviews performed by codex
    diffsIssues related to code diff views
    on Apr 25, 2026
  6. oxysoft commented on May 9, 2026

    @oxysoft

    Related CLI TUI root cause analysis: #21945 — the Rust TUI transcript overlay has the same O(n) rebuild problem. Large diffs would compound this since each diff cell gets full markdown re-parse + syntax highlighting on every overlay open, resize, and cell insertion. No virtualization or render caching anywhere in the pipeline.

  7. 0xdevalias commented on Jun 17, 2026

    @0xdevalias

    Potentially related:


    Likely partially impacted by rust-v0.140.0: #27489 caches turn-diff rendering so repeated apply_patch updates no longer re-render the entire accumulated diff after every patch. #27031 also removes a duplicate rollout-history read during cold thread/resume.

    That should reduce some lag in long sessions with large accumulated diffs, especially when many patches touch the same set of files. It probably does not fix the UI cost of actually displaying a huge diff, or bugs that produce an incorrect huge diff in the first place. Worth retesting on 0.140+ and keeping this open if large-diff display/review remains laggy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GitappIssues related to the Codex desktop appbugSomething isn't workingcode-reviewIssues relating to code reviews performed by codexdiffsIssues related to code diff viewsperformance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions