jquery.selectBoxIt.js icon indicating copy to clipboard operation
jquery.selectBoxIt.js copied to clipboard

SelectBoxIt takes ~4seconds to apply to 200 comboboxes. Is that expected?

Open sanychsamara opened this issue 11 years ago • 5 comments

We have been using SelectBoxIt for a few months and noticed that our app gets really slow when we redraw part of the page with several comboboxes. After profiling we found out that SelectBoxIt is very slow to apply/refresh. Is that expected? Do you have a suggestion on how to speed it up?

Thank you.

Here is a demo of the problem http://sandbox.my.shiprush.com/static.shiprush.com/ship.app/demos/styled-select/trimmed2.html

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/8313114-selectboxit-takes-4seconds-to-apply-to-200-comboboxes-is-that-expected?utm_campaign=plugin&utm_content=tracker%2F23157&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F23157&utm_medium=issues&utm_source=github).

sanychsamara avatar Feb 06 '14 23:02 sanychsamara

Unfortunately, when you create so many drop downs at the same time, you are bound to have performance issues (since the DOM is slow). That being said, there is an obvious optimization that you can make.

Turn off the autoWidth option

Turning this option off should improve rendering performance by ~33%.

$('select').selectBoxIt({ 'autoWidth': false });

Aside from that, I'm not sure what else I can do. I am open to suggestions though.

gfranko avatar Feb 07 '14 05:02 gfranko

It would be great if all

  • items are created on "click" on the down arrow and not on "init". This way combobox that are not used will not slow down "init".

    On Thu, Feb 6, 2014 at 9:55 PM, Greg Franko [email protected]:

    Unfortunately, when you create so many drop downs at the same time, you are bound to have performance issues (since the DOM is slow). That being said, there is an obvious optimization that you can make.

    Turn off the autoWidth option

    Turning this option off should improve rendering performance by ~33%.

    $('select').selectBoxIt({ 'autoWidth': false });

    Aside from that, I'm not sure what else I can do. I am open to suggestions though.

    Reply to this email directly or view it on GitHubhttps://github.com/gfranko/jquery.selectBoxIt.js/issues/248#issuecomment-34406242 .

  • sanychsamara avatar Feb 11 '14 19:02 sanychsamara

    I think that is reasonable. I'll look into providing an option like that for you.

    gfranko avatar Feb 11 '14 21:02 gfranko

    awesome. Let me know when this is available - I will test/profile performance for you :)

    On Tue, Feb 11, 2014 at 1:08 PM, Greg Franko [email protected]:

    I think that is reasonable. I'll look into providing an option like that for you.

    Reply to this email directly or view it on GitHubhttps://github.com/gfranko/jquery.selectBoxIt.js/issues/248#issuecomment-34807081 .

    sanychsamara avatar Feb 11 '14 21:02 sanychsamara

    I have some issues with performance too. I have a big select that freezes IE11 when is populating. I think it would be better use .innerHTML method instead of pure jQuery as you can see here: http://jsperf.com/creating-complex-elements/30.

    fakkio avatar Jan 21 '16 11:01 fakkio