Skip to content

perf: fix all performance issues from issue list#83

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-performance-issues
Draft

perf: fix all performance issues from issue list#83
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-performance-issues

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 12, 2026

Fixes 15 performance-related issues found in the issue tracker.

TypeScript/Node.js fixes:

Rust fixes:

Copilot AI and others added 2 commits May 12, 2026 12:48
TypeScript fixes:
- #77: Remove JSON.stringify indentation in store.ts and settings-store.ts
- #76: Replace Math.max spread with reduce in agent-history/index.ts
- #73: Replace JSON.stringify field check with .some() in gateway/bridge/input.ts
- #71: Replace Math.max spread with loop in usage/store.ts
- #70: Cache mergedPricing() to avoid repeated disk reads
- #74: Replace Array.shift() with index pointer in ThinkingState.prune()
- #75: Add LRU eviction to conversations/thinkingStates maps in adapter.ts
- #69: Avoid duplicate collectFiles() calls in session-cache.ts
- #68: Read only first 64KB per file in agent-history scanners (avoid full read)

Rust fixes:
- #63: Direct ElementInfo→HoverElement conversion without JSON round-trip
- #60: Switch template scaling from Lanczos3 to Triangle in find_image.rs
- #61: Remove intermediate Vec allocation in precompute_template
- #59: Use Cow<GrayImage> to avoid cloning full screenshot when no region
- #58/#57: Add HashMap index to ScreenshotCache and ImageCache for O(1) lookup
- #56: Eliminate JPEG→PNG round-trip in take_screenshot handler

Agent-Logs-Url: https://github.com/unbug/tday/sessions/89e1f6c9-ee1f-48d4-a8ea-5684c1298897

Co-authored-by: unbug <799578+unbug@users.noreply.github.com>
- Fix evictOldest() to use while loop instead of if (adapter.ts)
- Fix UTF-8 boundary handling in readFirstLines() using StringDecoder (scanners.ts)
- Rewrite ImageCache to use HashMap + VecDeque<key> without position indices (image_cache.rs)
- Rewrite ScreenshotCache to use HashMap + VecDeque<key> without position indices (screenshot_cache.rs)

Agent-Logs-Url: https://github.com/unbug/tday/sessions/89e1f6c9-ee1f-48d4-a8ea-5684c1298897

Co-authored-by: unbug <799578+unbug@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants