Skip to content

Remove usage of addNonEnumerableProperty from span utils #15808

Description

@AbhiPrasad

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions