Skip to content

Conversation

@andrewiggins
Copy link
Member

I've noticed in browser traces at work that the devtools extension is showing up a lot in traces and is causing jank in our page. While it doesn't affect users, I don't want my team to get the wrong impressions about Preact's perf when they are browsing localhost with devtools installed. So this change is attempting to improve the perf of devtools hooks so that it doesn't impact the page.

Sample screenshot of what I see in browser traces:
Screenshot 2023-01-27 at 2 56 36 PM

performance.clearMarks(start);
performance.clearMarks(end);
} catch (e) {
// Do nothing
Copy link

Choose a reason for hiding this comment

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

Maybe should log the error?

@marvinhagemeister marvinhagemeister merged commit 9275ceb into main Apr 25, 2024
@marvinhagemeister marvinhagemeister deleted the improve-perf branch April 25, 2024 08:58
@birtles
Copy link

birtles commented Apr 29, 2024

@andrewiggins I'm curious if you tested this with Firefox? I'm getting crazy slow performance in Firefox now which seems to be coming from clearMarks: https://share.firefox.dev/3xT7oGZ

@birtles
Copy link

birtles commented Apr 29, 2024

Oh, looks like Chrome is still on 4.7.1 so it might not be a Firefox-specific issue after all.

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.

5 participants