-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf(core): Remove usage of addNonEnumerableProperty from span utils #15765
perf(core): Remove usage of addNonEnumerableProperty from span utils #15765
Conversation
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ref #15725 (comment) Similar to the work done in #15765 we can avoid usage of `addNonEnumerableProperty` with usage of a `WeakSet`.
No clue why this is failing. I'm going to open up individual PRs for this, perhaps that will help |
a87a0de
to
a416137
Compare
Seems like #15811 is causing the issue. Reverting changes in |
nvm 😢 |
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.