This is a migrated thread and some comments may be shown as answers.

Slowdown because of height calculation

3 Answers 29 Views
MultiSelect
This is a migrated thread and some comments may be shown as answers.
Lala
Top achievements
Rank 1
Lala asked on 07 Jan 2015, 08:26 AM
Yey, just lost my bugreport... So once again

Hi there

I'm using the multiselect inside a form to allow the selection of persons. Where talking about 300 - 400 entries. In some cases it is needed, that all persons can be selected. So I added a Function which gets all dataSource entries and sets them as value.

Unfortunately this takes "ages" (about 2-3 sec) and on some workstations even leads to a script timeout. Running Firebug profile, I found out that this is caused by the _select() method of the multiselect widget. In particular by the "that._height(that._visibleItems);" which is, caused by the array loop, called for every data item. If I move this line to the value() method and insert it after the select loop, consumed time drops almost by half.

I don't see why the height needs to be calculated on every data item. I couldn't detect any side effects yet, but maybe there are. Still I would suggest to move the height calculation from the _select() method.

3 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 08 Jan 2015, 01:03 PM

Hello Patric,

The _select() method is used in other scenarios different than the call from the value() method, this is why the height calculation is needed for every _select() call. However the following enhancement if implemented, will give performance boost. So please check when this is resolved:

https://github.com/telerik/kendo-ui-core/issues/465 

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Lala
Top achievements
Rank 1
answered on 08 Jan 2015, 02:26 PM
Thank you for the fast reply. I will keep an eye on it.
0
Kiril Nikolov
Telerik team
answered on 08 Jan 2015, 02:34 PM

Hello Patric,

Glad I helped.

In case you have any further questions, please do not hesitate to contact us.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
MultiSelect
Asked by
Lala
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Lala
Top achievements
Rank 1
Share this question
or