Bug Tracker

Opened 14 years ago

Closed 13 years ago

Last modified 11 years ago

#4004 closed enhancement (fixed)

Speed up DOM removal by decoupling event.remove and removeData

Reported by: tr4nslator Owned by:
Priority: major Milestone: 1.3.2
Component: core Version: 1.3.1
Keywords: dom remove Cc:
Blocked by: Blocking:


(as discussed here on jQuery dev)

All jQuery operations that remove DOM nodes (including $.fn.replaceWith, $.fn.empty, $.fn.html, and $.fn.text) use $.fn.remove internally to centralize processing for removing events and expando data.

Many of these methods could be made faster by decoupling element death from DOM removal: once elements are killed, they could be replaced using the fastest method: Node.prototype.innerHTML for $.fn.empty, and Node.prototype.replaceChild for $.fn.replaceWith (which is 20% faster than the current method of appending and then removing).

Change History (2)

comment:1 Changed 14 years ago by yehuda

detach() which doesn't remove data is in #6474. Work to use it and use alternative mechanisms is still pending.

comment:2 Changed 13 years ago by dmethvin

Resolution: fixed
Status: newclosed

This was done in 1.4 by refactoring into removeData internally.

Note: See TracTickets for help on using tickets.