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

Skip unnecessary trace render loop in WebSockets mode #1123

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

wwwillchen
Copy link
Collaborator

@wwwillchen wwwillchen commented Dec 3, 2024

This skips the trace mode render loop in WebSockets mode which is a significant perf improvement, since we can use the last render loop because the Context is long-lived across multiple UI requests (for the same session).

This always registers the event handler regardless of whether we're in trace mode. For non-WebSockets mode, there's no practical difference.

@wwwillchen wwwillchen requested a review from richard-to December 3, 2024 06:47
Copy link
Collaborator

@richard-to richard-to left a comment

Choose a reason for hiding this comment

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

Nice. Great optimization. Makes sense to always register the event handlers whether in trace mode or not. Makes the code a bit easier to read there too.

@wwwillchen wwwillchen merged commit 8fabc6c into google:main Dec 3, 2024
6 checks passed
@wwwillchen wwwillchen deleted the ws-no-trace branch December 3, 2024 23:28
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