sortable: Use addClass in _setHandleClassName to improve performance
This addresses #2062 and is relevant for large lists with more than 1000 items.
The solution to the issue was suggested at stackoverflow.com (credits to @Ernst). At the end this commit restores the function's behaviour of previous 1.11.x version.
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: naitsirch (7e7a6c4a0dcf174e4016ffa1dacb45b0052c884f)
I am also seeing this performance regression in jQuery UI 1.12.1, used as part of redmine 4 (backlogs plugin). Applying the patch (I didn't apply the change to the _destroy function) leads to a pretty spectacular speedup when rendering hundreds of items in a sorted list (it eliminates a ~30s wait), and brings back the performance to the level it was at with jQuery UI 1.11.x. It would be good to see this regression fixed.
The risk here is that the proposed mechanism skips the logic used to handle classes which can bite in future changes to the library. I'm not that happy with hacks like that as they can bite in the future, edge cases can be discovered, etc.
It'd be better to understand what exactly causes the slowdown and see if there's a fix in the logic possible that would speed things up. See #2037 for an example of such a PR. It solved issue #2014 without skipping any core logic.
I don't have time to dive into this too much at the moment but if anyone finds a proper fix, I'd be happy to review such a PR, feel free to ping me in a PR then.