Skip to content

feat(opencode): core performance optimizations#8922

Closed
AungMyoKyaw wants to merge 1 commit intoanomalyco:devfrom
AungMyoKyaw:feat/performance-optimizations
Closed

feat(opencode): core performance optimizations#8922
AungMyoKyaw wants to merge 1 commit intoanomalyco:devfrom
AungMyoKyaw:feat/performance-optimizations

Conversation

@AungMyoKyaw
Copy link

Summary

This PR implements several high-impact optimizations to the OpenCode core to improve efficiency during AI interaction and file exploration.

Changes

  • I/O Buffering: Session.updatePart now buffers streaming deltas in memory, reducing disk writes from O(N) to O(1) per message part.
  • Compact Storage: Switched to compact JSON for internal state persistence, reducing I/O payload size.
  • Ripgrep Caching: Added a 5-second results cache for Ripgrep.tree to significantly speed up file exploration in large repositories.

Verification

  • Verified with lsp_diagnostics.
  • Ensured stability of core loops during streaming.

…ration

- Implemented write buffering in Session.updatePart to reduce disk I/O frequency during streaming.
- Switched storage to compact JSON to reduce payload size and serialization overhead.
- Added a 5-second cache for Ripgrep.tree results to accelerate file exploration.
@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found one potentially related PR:

PR #1163: TUI Performance Optimization
#1163

This PR focuses on TUI (Terminal User Interface) performance optimization. While it's a different layer than the core optimizations in PR #8922 (which focuses on I/O buffering, storage, and ripgrep caching), it may be worth reviewing to ensure there's no overlap in optimization efforts or conflicts in implementation.

However, the PRs appear to target different components (core vs. TUI), so they are likely complementary rather than duplicates.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments