Remove usage of addNonEnumerableProperty
from span utils
#15808
Labels
addNonEnumerableProperty
from span utils
#15808
Description
ref #15725 (comment)
addNonEnumerableProperty
is pretty expensive because ofObject.defineProperty
, so this changes usage of span utils (which are called frequently) to avoid usage ofaddNonEnumerableProperty
.addNonEnumerableProperty
is replaced with weak maps, which has the added benefit of being more GC friendly (addNonEnumerableProperty
causes hard references to be created between the objects).The only downside of switching to this approach is that we lose the
try catch
built intoaddNonEnumerableProperty
, but I think thats fine given the nature of the changed methods.This was originally done in #15765, but because tests were failing extracing this out to an issue.
The text was updated successfully, but these errors were encountered: