If we make AddReference/RemoveReference take an nsINode*, not a void* as the key, we could set a bit on the node when the reference is added and remove it when it's removed. Then during cycle collection we could check that bit before hitting the hashtable. Since most nodes don't have a preserved wrapper, this ought to be a win, I think.
11 years ago
Note that with sicking's patch to short-circuit traversal of currently-displayed documents this may not be as much of a problem anymore...
I'm going to dupe this to bug 457022 (cached wrappers), since we only traverse to the cached wrapper if a bit is set (see WRAPPER_BIT_PRESERVED) and we only put the objects in a hash if they have a preserved wrapper.