Skip to content

jQuery UI Autocomplete widget (version 1.13.0) renders results slower than version 1.12.0 #2040

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

Closed
hptruc opened this issue Jan 15, 2022 · 6 comments

Comments

@hptruc
Copy link

hptruc commented Jan 15, 2022

Hi everyone, @mgol,

I have an issue with the jQuery UI Autocomplete widget after migrating from version 1.12.0 to 1.13.0 to fix security issues. This new version doesn't work smoothly. The results display on the screen slowly and sometimes freeze the UI.

Below is an example that I reproduced to demonstrate the speed difference between the 2 versions of jQuery UI.

The environment and libraries I use:

  • Chrome 97.0.4692.71
  • jQuery 3.6.0

Steps to reproduce

  1. Type a few characters into the textbox and wait for the results to appear.
  2. Clear all characters in the textbox by pressing the backspace key on the keyboard.

Result:

  • 1.12.0: the results show up quickly (1-2 seconds) and I can change the characters in the text box to next search.
  • 1.13.0: very slow display results (5-6 seconds), screen freezes and I can't do anything.

Anyone have a solution for this issue? @mgol, I think this is a bug and it affects the user experience.

Many thanks,
Tapi

@mgol
Copy link
Member

mgol commented Jan 15, 2022

Thanks for the report with a test case!

I hoped it would be related to #2014 which I fixed in #2037 but it looks that the latest development copy still exhibits the issue: https://codepen.io/mgol/pen/dyVagYY.

I'll have a look.

@mgol mgol self-assigned this Jan 15, 2022
@mgol mgol added this to the 1.13.1 milestone Jan 15, 2022
@mgol mgol removed this from the 1.13.1 milestone Jan 15, 2022
@mgol mgol removed their assignment Jan 15, 2022
@mgol
Copy link
Member

mgol commented Jan 16, 2022

Oh, actually, I take that back; the dev copy of jQuery UI hasn't been updated after my PR was merged; I fixed that now. The pen I linked above (https://codepen.io/mgol/pen/dyVagYY) - which uses the dev version of jQuery UI - seems to not have these perf issues.

Can you test with https://releases.jquery.com/git/ui/jquery-ui-git.js and double-check it works fine now? Don't use this copy in production as it can break any time but the current state of that file should be roughly what ends up in 1.13.1 which I plan to release soon if everything goes right.

@hptruc
Copy link
Author

hptruc commented Jan 16, 2022

Thank you very much for your support.

I retested this issue with version 1.13.1-pre and I have a few comments:

  • Result response time has been improved. However, I feel it's still a bit slower than version 1.12.
  • UI no longer freezes.

Could you share the release date of version 1.13.1? @mgol

I migrated the jQuery UI in my project to version 1.13.0 to fix some security issues and I will deploy the patch to production next week.

@nagyimre1980
Copy link

it would be important to me this week too. 1.13.1 rc1 release?

@mgol
Copy link
Member

mgol commented Jan 16, 2022

I can’t promise anything but if nothing goes wrong I’m planning to do a 1.13.1 release next week.

@mgol
Copy link
Member

mgol commented Jan 16, 2022

@hptruc it’s not surprising that it’s slightly slower as #1769 added registration of additional cleanup logic that takes some time; I just optimized that logic in #2037 without changing semantics of it. The 1.12.1 implementation didn’t have this cleanup logic but was leaking memory a lot, causing issues for longer running widgets.

Since there’s no longer a UI freeze, I’m going to close it as a duplicate of #2014. Thanks!

@mgol mgol closed this as completed Jan 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants