Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

perf: fix all performance issues from issue list#83

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

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

Conversation

Copilot AI commented May 12, 2026

Copy link
×ばつ faster with acceptable quality loss for template matching) - **#61** – Remove intermediate `Vec<f64>` allocation in `precompute_template` with a two-pass (mean then norm) loop over the image pixels - **#59** – Use `Cow<GrayImage>` in `find_image` to borrow the screenshot directly when no search region is specified, avoiding a full clone - **#58/#57** – Replace linear-scan `VecDeque<CachedScreenshot/CachedImage>` with `HashMap<id, data>` + `VecDeque<id>` for O(1) lookups in `ScreenshotCache` and `ImageCache` - **#56** – Eliminate the extra `spawn_blocking` JPEG→PNG round-trip in `handle_take_screenshot`; both the JPEG (for the response) and PNG (for the cache) are now produced in a single blocking task" data-view-component="true"> Copy Markdown
Contributor

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

Reviewers

@unbug unbug Awaiting requested review from unbug

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /