Opened 9 months ago

Closed 8 months ago

Last modified 8 months ago

#15049 closed bug (notabug)

Calling refresh several times makes it slower and slower

Reported by: TimePerformance Owned by: TimePerformance
Priority: minor Milestone: none
Component: ui.selectable Version: 1.12.0
Keywords: Cc:
Blocked by: Blocking:

Description

Each call to $el.selectable('refresh') is slower than the previous, starting from 200ms and going to more than 10 seconds. (for hundreds of selectees)

The problem comes from the line:

that._addClass( that.selectees, "ui-selectee" );

I have seen an issue for v1.12.0 and upgraded to v1.12.1, but it did not solve the problem.

Replacing the line above by:

that.selectees.addClass("ui-selectee");

solves the performance issue.

Change History (4)

comment:1 Changed 9 months ago by Scott González

Version: 1.11.21.12.0

comment:2 Changed 9 months ago by Alexander Schmitz

Owner: set to TimePerformance
Status: newpending

I cannot reproduce this at all. I set up a test page which benchmarks the refresh function as you can see there is no upward trend http://jsbin.com/zoxotu/edit?html,js,output is there something more i need to do to trigger this? I also tried selecting different sets in between refreshes and this made no difference

comment:3 Changed 8 months ago by Scott González

Resolution: notabug
Status: pendingclosed

Closing due to inactivity.

comment:4 Changed 8 months ago by henkpb

I have encountered a similar problem in my application, where selectmenu("refresh") gets slower and slower. Please check http://jsbin.com/nibibohigi/edit?html,js,output for a basic example. I have seen that the

this.bindings = this.bindings.add( element ) 

in the _on method in $.Widget.prototype causes the problem. The list of bindings increases on each refresh - it ends up containing thousands of entries.

Note: See TracTickets for help on using tickets.