We're seeing enormous numbers of calls to item.isSelected and item.itemIsValid on every navigate (50-100 calls to each of those functions for each navigation click in the sample index.html). The isSelected call is constructing a new anchor element on every invocation to do relative URL checking.
This PR reuses the anchor element which cut the number of leaked anchors to almost 0 (down from tens of thousands after navigating around for a while).
We're seeing enormous numbers of calls to
item.isSelected
anditem.itemIsValid
on every navigate (50-100 calls to each of those functions for each navigation click in the sample index.html). TheisSelected
call is constructing a new anchor element on every invocation to do relative URL checking.@spadgett tracked this down as the source of a memory leak in https://github.com/openshift/origin/issues/1921#issuecomment-108141275
This PR reuses the anchor element which cut the number of leaked anchors to almost 0 (down from tens of thousands after navigating around for a while).