Skip to main content

Bug Tracker

Side navigation

#8792 closed enhancement (wontfix)

Opened April 06, 2011 08:27PM UTC

Closed July 25, 2011 04:20PM UTC

Last modified March 13, 2012 02:49PM UTC

Attach data objects directly to DOM elements

Reported by: dmethvin Owned by:
Priority: blocker Milestone: 1.7
Component: data Version: 1.5.2
Keywords: 1.7-discuss Cc:
Blocked by: Blocking:
Description

Only IE6 and IE7 are unable to garbage-collect JavaScript objects, I think the other browsers can handle cleanup themselves.

Switch to direct attach for those cases. This means we don't need to clean up data and events when elements are removed from the DOM, should be a perf boost.

This will require a change to global events since there will jQuery.cache will no longer contain all data for all objects and jQuery.event.trigger can't sneak a peek into the cache to trigger them.

Need a feature detect I can use to determine whether it's safe to attach data to a DOM object.

Attachments (0)
Change History (15)

Changed April 07, 2011 08:19PM UTC by timmywil comment:1

component: unfiledevent
milestone: 1.next1.6
owner: → dmethvin
priority: undecidedhigh
status: newassigned

Changed April 15, 2011 03:31PM UTC by dmethvin comment:2

milestone: 1.61.7
priority: highlow

Deferred for discussion in 1.7; due to the remaining cases that need to be handled (i.e., removing special events and triggering global events) it may not offer enough benefits to be worthwhile.

Changed April 17, 2011 12:47AM UTC by john comment:3

milestone: 1.71.next
owner: dmethvin
status: assignedopen

Let's discuss this in the roadmap meeting.

Changed May 22, 2011 07:27PM UTC by john comment:4

keywords: → 1.7-discuss

Nominating ticket for 1.7 discussion.

Changed May 22, 2011 09:28PM UTC by rwaldron comment:5

+1,

Changed May 23, 2011 12:37AM UTC by jaubourg comment:6

-1, I don't see any possible feature test, hence why I'll vote negatively

Changed May 23, 2011 01:02AM UTC by rwaldron comment:7

I might be way off here but if we know that UAs that support deleting expandos are safe, then could we assume jQuery.support.deleteExpando is safe way to determine which browser to use internal cache (false) or attach directly (true)?

Changed May 23, 2011 01:02AM UTC by rwaldron comment:8

component: eventdata

Changed May 23, 2011 04:28AM UTC by timmywil comment:9

description: Only IE6 and IE7 are unable to garbage-collect JavaScript objects, I think the other browsers can handle cleanup themselves. \ \ Switch to direct attach for those cases. This means we don't need to clean up data and events when elements are removed from the DOM, should be a perf boost. \ \ This will require a change to global events since there will jQuery.cache will no longer contain all data for all objects and jQuery.event.trigger can't sneak a peek into the cache to trigger them. \ \ Need a feature detect I can use to determine whether it's safe to attach data to a DOM object. \ Only IE6 and IE7 are unable to garbage-collect JavaScript objects, I think the other browsers can handle cleanup themselves.\ \ Switch to direct attach for those cases. This means we don't need to clean up data and events when elements are removed from the DOM, should be a perf boost.\ \ This will require a change to global events since there will jQuery.cache will no longer contain all data for all objects and jQuery.event.trigger can't sneak a peek into the cache to trigger them. \ \ Need a feature detect I can use to determine whether it's safe to attach data to a DOM object.\

+0,

Changed May 24, 2011 09:27PM UTC by dmethvin comment:10

description: Only IE6 and IE7 are unable to garbage-collect JavaScript objects, I think the other browsers can handle cleanup themselves.\ \ Switch to direct attach for those cases. This means we don't need to clean up data and events when elements are removed from the DOM, should be a perf boost.\ \ This will require a change to global events since there will jQuery.cache will no longer contain all data for all objects and jQuery.event.trigger can't sneak a peek into the cache to trigger them. \ \ Need a feature detect I can use to determine whether it's safe to attach data to a DOM object.\ Only IE6 and IE7 are unable to garbage-collect JavaScript objects, I think the other browsers can handle cleanup themselves. \ \ Switch to direct attach for those cases. This means we don't need to clean up data and events when elements are removed from the DOM, should be a perf boost. \ \ This will require a change to global events since there will jQuery.cache will no longer contain all data for all objects and jQuery.event.trigger can't sneak a peek into the cache to trigger them. \ \ Need a feature detect I can use to determine whether it's safe to attach data to a DOM object. \

-1, Based on my previous exploration, I don't think this will have a payback until we eliminate global events and possibly until IE6/7 die.

Changed June 03, 2011 01:53PM UTC by john comment:11

description: Only IE6 and IE7 are unable to garbage-collect JavaScript objects, I think the other browsers can handle cleanup themselves. \ \ Switch to direct attach for those cases. This means we don't need to clean up data and events when elements are removed from the DOM, should be a perf boost. \ \ This will require a change to global events since there will jQuery.cache will no longer contain all data for all objects and jQuery.event.trigger can't sneak a peek into the cache to trigger them. \ \ Need a feature detect I can use to determine whether it's safe to attach data to a DOM object. \ Only IE6 and IE7 are unable to garbage-collect JavaScript objects, I think the other browsers can handle cleanup themselves.\ \ Switch to direct attach for those cases. This means we don't need to clean up data and events when elements are removed from the DOM, should be a perf boost.\ \ This will require a change to global events since there will jQuery.cache will no longer contain all data for all objects and jQuery.event.trigger can't sneak a peek into the cache to trigger them. \ \ Need a feature detect I can use to determine whether it's safe to attach data to a DOM object.\

+1, I think this is fine to push for - global events can be tracked/handled separately (easily, even). And we can use deleteExpando to feature test it. I'm for it.

Changed June 03, 2011 04:00PM UTC by scottgonzalez comment:12

+1, if we've got a good way to detect and we get a perf boost, why not?

Changed June 05, 2011 09:28PM UTC by ajpiano comment:13

description: Only IE6 and IE7 are unable to garbage-collect JavaScript objects, I think the other browsers can handle cleanup themselves.\ \ Switch to direct attach for those cases. This means we don't need to clean up data and events when elements are removed from the DOM, should be a perf boost.\ \ This will require a change to global events since there will jQuery.cache will no longer contain all data for all objects and jQuery.event.trigger can't sneak a peek into the cache to trigger them. \ \ Need a feature detect I can use to determine whether it's safe to attach data to a DOM object.\ Only IE6 and IE7 are unable to garbage-collect JavaScript objects, I think the other browsers can handle cleanup themselves. \ \ Switch to direct attach for those cases. This means we don't need to clean up data and events when elements are removed from the DOM, should be a perf boost. \ \ This will require a change to global events since there will jQuery.cache will no longer contain all data for all objects and jQuery.event.trigger can't sneak a peek into the cache to trigger them. \ \ Need a feature detect I can use to determine whether it's safe to attach data to a DOM object. \

+0, This was Dave's idea, and he seems to have done the exploration proving that it seems unviable - but if we're willing to make the resulting architecture changes required, then it seems workable

Changed July 12, 2011 03:03PM UTC by dmethvin comment:14

milestone: 1.next1.7
priority: lowblocker

Changed July 25, 2011 04:20PM UTC by john comment:15

resolution: → wontfix
status: openclosed

Closing until we remove global events.