Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(background/tabEvents): memoize setIcon call #598

Merged
merged 2 commits into from
Sep 17, 2024

Conversation

sidvishnoi
Copy link
Member

@sidvishnoi sidvishnoi commented Sep 16, 2024

In Chrome, we get 3 fetch requests on each setIcon calls even if setting same icon. Each request takes 5-25ms, which is unnecessary and noisy as well.

@github-actions github-actions bot added the area: background Improvements or additions to extension background script label Sep 16, 2024
Copy link
Contributor

github-actions bot commented Sep 16, 2024

Extension builds preview

Name Link
Latest commit 19192a6
Latest job logs Run #10885585971
BadgeDownload
BadgeDownload

}

setIcon(tabId: TabId, icon: Record<number, string>) {
this.currentIcon.set(tabId, icon);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: we're only storing the reference here, not the full data.

@raducristianpopa raducristianpopa merged commit d8a4e01 into main Sep 17, 2024
9 checks passed
@raducristianpopa raducristianpopa deleted the perf-icon-preserve branch September 17, 2024 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: background Improvements or additions to extension background script
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants