jquery/jquery-ui — pull request #1182 by amakhrov (2014-01-23 00:37:42+00:00)
Title: Only run triggerHandler( "remove" ) for widgets

ui.widget overrides the `$.cleanData` method to also call `.triggerHandler( "remove" )` method. According to Chrome's profiler, triggerHandler is a relatively slow method.

When element is being removed with `$(elem).remove()`, `$.cleanData` is called for each descendant element - and there can be thousands of those elements!

This is an attempt to only execute `triggerHandler( "remove" )` for elements that are jQueryUI Widgets and skip that for all other elements.