Description
Description
ref #15725 (comment)
addNonEnumerableProperty
is pretty expensive because of Object.defineProperty
, so this changes usage of span utils (which are called frequently) to avoid usage of addNonEnumerableProperty
.
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 into addNonEnumerableProperty
, 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.