[PR #1040] [MERGED] perf: move ANSI regex compilations to package level #9786

Closed
opened 2026-02-16 18:14:10 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/1040
Author: @matiasinsaurralde
Created: 7/16/2025
Status: Merged
Merged: 7/16/2025
Merged by: @adamdotdevin

Base: devHead: perf/precompile-regexp


📝 Commits (1)

  • 6e56d6b perf: move ANSI regex compilation to package level to avoid repeated compilation

📊 Changes

2 files changed (+9 additions, -4 deletions)

View changed files

📝 packages/tui/internal/components/diff/diff.go (+4 -1)
📝 packages/tui/internal/layout/overlay.go (+5 -3)

📄 Description

Prevents the regexps from being recompiled on every function call, which improves performance especially when these functions are called frequently during diff rendering and overlay operations.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/1040 **Author:** [@matiasinsaurralde](https://github.com/matiasinsaurralde) **Created:** 7/16/2025 **Status:** ✅ Merged **Merged:** 7/16/2025 **Merged by:** [@adamdotdevin](https://github.com/adamdotdevin) **Base:** `dev` ← **Head:** `perf/precompile-regexp` --- ### 📝 Commits (1) - [`6e56d6b`](https://github.com/anomalyco/opencode/commit/6e56d6b3bbd564295a3bebc2e2b7599117b50c6c) perf: move ANSI regex compilation to package level to avoid repeated compilation ### 📊 Changes **2 files changed** (+9 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `packages/tui/internal/components/diff/diff.go` (+4 -1) 📝 `packages/tui/internal/layout/overlay.go` (+5 -3) </details> ### 📄 Description Prevents the regexps from being recompiled on every function call, which improves performance especially when these functions are called frequently during diff rendering and overlay operations. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:14:10 -05:00
yindo closed this issue 2026-02-16 18:14:10 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9786