[PERF] /undo /redo really slow on larger repos and/or long histories #8149

Open
opened 2026-02-16 18:09:16 -05:00 by yindo · 1 comment
Owner

Originally created by @zekronium on GitHub (Jan 31, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

For large repositories or for repositories with long git histories, where .git is large, /undo and /redo performance is really slow

Not entirely sure how the progress is stored in the .git index and why would it exponentially slow down with the size of the .git history, especially when changes are NOT committed during the session

The file changes are also not large and do not seem to relate with any in session work. A fresh session with a simple message "hi" will take 10-15s to undo. Redo seems to take 2-3x longer than what undo took

Plugins

None

OpenCode version

1.1.48

Steps to reproduce

  1. Open Large Repo / Long Git History
  2. undo a message - slow
  3. redo a message - slower

Screenshot and/or share link

No response

Operating System

macos 15.7.3

Terminal

Ghossty

Originally created by @zekronium on GitHub (Jan 31, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description For large repositories or for repositories with long git histories, where `.git` is large, /undo and /redo performance is really slow Not entirely sure how the progress is stored in the .git index and why would it exponentially slow down with the size of the `.git` history, especially when changes are NOT committed during the session The file changes are also not large and do not seem to relate with any in session work. A fresh session with a simple message "hi" will take 10-15s to undo. Redo seems to take 2-3x longer than what undo took ### Plugins None ### OpenCode version 1.1.48 ### Steps to reproduce 1. Open Large Repo / Long Git History 2. undo a message - slow 3. redo a message - slower ### Screenshot and/or share link _No response_ ### Operating System macos 15.7.3 ### Terminal Ghossty
yindo added the bugperf labels 2026-02-16 18:09:16 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 31, 2026):

Thanks for the detailed report! I've searched through existing issues and found a potentially related issue that could contribute to this problem:

  • #4704: /undo and /timeline undo does not revert file edits (functionality issue with the undo system itself)

Additionally, there may be an underlying issue with how snapshots/git operations are handled on large repositories that could contribute to the exponential slowdown you're experiencing.

This appears to be primarily a performance issue specific to the /undo /redo commands on large repos, rather than a duplicate of existing reports. Your detailed steps to reproduce and the specific timing (10-15s for undo, 2-3x slower for redo) will be helpful in diagnosing this.

@github-actions[bot] commented on GitHub (Jan 31, 2026): Thanks for the detailed report! I've searched through existing issues and found a potentially related issue that could contribute to this problem: - #4704: /undo and /timeline undo does not revert file edits (functionality issue with the undo system itself) Additionally, there may be an underlying issue with how snapshots/git operations are handled on large repositories that could contribute to the exponential slowdown you're experiencing. This appears to be primarily a performance issue specific to the /undo /redo commands on large repos, rather than a duplicate of existing reports. Your detailed steps to reproduce and the specific timing (10-15s for undo, 2-3x slower for redo) will be helpful in diagnosing this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8149