Skip to content

Remove usage of addNonEnumerableProperty from span utils #15808

Open
1 of 1 issue completed
Open
Improvement
1 of 1 issue completed
@AbhiPrasad

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.

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions