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

Teambuilder: Debounce searching teams #2270

Merged
merged 2 commits into from
Aug 29, 2024

Conversation

PartMan7
Copy link
Contributor

Wasn't fun having my browser frozen for half a minute every time I typed more than two letters in the teambuilder search; this PR introduces debounced calls to updateTeamList() instead of direct calls.

Tested locally on Chrome 127.0.6533.72

@PartMan7 PartMan7 force-pushed the chore/debounce-teambuilder-search branch from 77ba9d9 to 06aa133 Compare July 27, 2024 20:28
@Zarel
Copy link
Member

Zarel commented Jul 29, 2024

Ten years ago this was instantaneous enough, and computers have only gotten better since then. Probably this should at least be a setting?

@PartMan7
Copy link
Contributor Author

Takes about 5-10s per character input on my device (which has fairly decent specs); this isn't an issue for people who don't store teams, but for people with a lot (I'm around 9K or so), it is... problematic, to say the least. I'm not sure if there's any benefit to not having it debounced (except the removal of the 300ms typing delay), but it offers pretty noticeable benefits for users that do.

Copy link
Contributor Author

@PartMan7 PartMan7 Jul 29, 2024

Choose a reason for hiding this comment

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

Wait just saw this; will remove when I get home

@PartMan7 PartMan7 force-pushed the chore/debounce-teambuilder-search branch from 06aa133 to fa6190b Compare July 29, 2024 15:12
@PartMan7 PartMan7 force-pushed the chore/debounce-teambuilder-search branch from f589119 to 1fb295f Compare August 9, 2024 02:33
@Zarel
Copy link
Member

Zarel commented Aug 9, 2024

Why does this only get laggy at a high team count? Is the team list still hidden somewhere in the DOM?

@Zarel
Copy link
Member

Zarel commented Aug 9, 2024

Probably that's the bug to fix.

@Zarel Zarel merged commit ef737c3 into smogon:master Aug 29, 2024
1 check passed
@Zarel
Copy link
Member

Zarel commented Aug 29, 2024

Thanks! This is a good stopgap until we get a real fix in.

shrianshChari pushed a commit to shrianshChari/pokemon-showdown-client that referenced this pull request Oct 8, 2024
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