-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat(core): Cache processed stacks for debug IDs #7825
Conversation
size-limit report 📦
|
@@ -114,6 +114,8 @@ function applyClientOptions(event: Event, options: ClientOptions): void { | |||
} | |||
} | |||
|
|||
const debugIdStackParserCache = new Map<StackParser, Map<string, StackFrame[]>>(); |
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.
Should we use WeakMap
to ensure garbage collection can still work? Or will this mess the cache up 🤔
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.
We can!
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.
Did think about this but I thought weak map wasn't a thing in ie11 - turns out it is.
Cache processed debug ID stack frames so we don't have to recompute them every error event.