Button Initialization Slow
|Reported by:||marcrohloff||Owned by:|
Initializing a button (or buttonset) is very slow with a large DOM. I tracked down the issue to the following lines in the _determineButtonType function:
this.buttonElement = this.element.parents().last() .find( "[for=" + this.element.attr("id") + "]" );
This does an attribute based search on the whole document (parents().last() which is very slow and also seems unnecessary. IMO, This can be sped up in two ways (1) Only search under the immediate parent, (2) limit the search to labels. i.e.
this.buttonElement = this.element.parent() .find( "label[for=" + this.element.attr("id") + "]" );