Skip to content

perf(client): reduce reload debounce #20429

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

Merged
merged 2 commits into from
Jul 25, 2025

Conversation

sapphi-red
Copy link
Member

Description

This debounce makes all reload requests to be deferred at least 50ms, which is a bit long.
Given that this was introduced for #13512, I guess 10ms is enough. #13512 isn't clear what happened there, and if it is caused by git switch, I think the multiple reload requests would be sent within 10ms.

refs #13545

@sapphi-red sapphi-red added the p2-nice-to-have Not breaking anything but nice to have (priority) label Jul 19, 2025
Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

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

Perhaps we can test how this affects reloads in practice before merging? Generally I think the reload itself and network requests after is going to take some time too that a 40ms reduction will probably be unnoticable. A slower machine might also process things slower when doing git switch and stuff.

If we're directly reducing and test it out by users, I'm a bit more comfortable with 20ms first.

@sapphi-red
Copy link
Member Author

20ms works for me. I feel a small lag with 50ms, but 20ms feels instant.

@sapphi-red sapphi-red added this to the 7.1 milestone Jul 25, 2025
Copy link
Member

@patak-dev patak-dev left a comment

Choose a reason for hiding this comment

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

Any number here feels a bit arbitrary. But I imagine 20ms is ok to try and see if there are any issues.

@patak-dev patak-dev merged commit 22ad43b into vitejs:main Jul 25, 2025
16 checks passed
@sapphi-red sapphi-red deleted the perf/client-reduce-reload-debounce branch July 25, 2025 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants