Ticket #7992 (closed bug: wontfix)
jQuery 1.5b1 is slower to remove elements than 1.4.2
| Reported by: | brad@… | Owned by: | snover |
|---|---|---|---|
| Priority: | blocker | Milestone: | 1.5 |
| Component: | manipulation | Version: | 1.5b1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Adding and removing elements in 1.5b1 is noticably slower than in 1.4.2 (it was also slower in 1.4.3 and 1.4.4
Change History
comment:2 Changed 2 years ago by rwaldron
- Priority changed from undecided to blocker
- Status changed from new to open
- Component changed from unfiled to manipulation
comment:3 Changed 2 years ago by anonymous
Please see this related bug http://bugs.jquery.com/ticket/7338 This broke in 1.4.3
comment:5 Changed 2 years ago by john
- Owner set to snover
- Status changed from open to assigned
- Milestone changed from 1.next to 1.5
comment:7 Changed 2 years ago by rwaldron
The issue is traceable to the extra work being performed in cleanData()
comment:8 Changed 2 years ago by john
Better perf test: http://jsperf.com/jquery-remove
comment:9 Changed 2 years ago by john
- Status changed from assigned to closed
- Resolution set to wontfix
There were virtually no changes to cleanData in 1.5 - only the addition of some minor property lookups. There's really nothing that we can do to make this much faster.
comment:10 Changed 2 years ago by anonymous
So this was slow enough for us that we could not upgrade from 1.4.2 ro 1.4.3 in our app. People complained when we switched. I really think that its important that things don't get noticeably slower between releases.
comment:11 Changed 2 years ago by snover
How many elements are you removing from your page at once? Worst-case benchmarking on 1.5b in IE was something like 0.027ms per element. Based on the information and testcase provided, problems here would tend to suggest an architectural issue with your app rather than a problem in the lib; you would need to be removing tens of thousands of elements per second for the problem to be noticeable, unless there is a significant difference between the testcase and your app (like lots of bound events).
comment:12 Changed 2 years ago by anonymous
So it was removing one element but there were a lot of elements inside of it. It was extremely poor on IE which forced us to revert to 1.4.2
comment:13 Changed 2 years ago by rwaldron
Anonymous,
This ticket was addressed today at our weekly jQuery meeting, which is a public discussion on IRC int he #jquery-meeting channel.
During the discussion, this perf test: http://jsperf.com/jquery-remove was created and we can agree that there is not a significant slow down.
If you could try 1.5b and report your findings, that would be very helpful to us.
comment:14 Changed 2 years ago by brad@…
So we used the same test you provided on IE8 and its 61% slower
http://www.screencast.com/users/JoeG816/folders/Jing/media/372a1b29-5cef-44a9-9c49-989ed1dc7d67
There is clearly a problem here - its the same performance issue that we began to see on 1.4.3.
comment:15 Changed 2 years ago by brad@…
I would also add that the same test http://jsperf.com/jquery-remove runs 38% lowers on FF 3.6 with 1.5 vs 1.4.2.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

http://jsperf.com/jquery142-vs-jquery-15b1