Skip to content
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

Merged
merged 2 commits into from Apr 14, 2023

Conversation

lforst
Copy link
Member

@lforst lforst commented Apr 12, 2023

Cache processed debug ID stack frames so we don't have to recompute them every error event.

@lforst lforst marked this pull request as ready for review April 12, 2023 11:19
@github-actions
Copy link
Contributor

github-actions bot commented Apr 12, 2023

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 21.02 KB (+0.39% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 65.63 KB (+0.29% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 19.58 KB (+0.45% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 58.08 KB (+0.35% 🔺)
@sentry/browser - Webpack (gzipped + minified) 21.17 KB (+0.36% 🔺)
@sentry/browser - Webpack (minified) 69.03 KB (+0.29% 🔺)
@sentry/react - Webpack (gzipped + minified) 21.2 KB (+0.37% 🔺)
@sentry/nextjs Client - Webpack (gzipped + minified) 48.98 KB (+0.18% 🔺)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 28.58 KB (+0.31% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 26.82 KB (+0.31% 🔺)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 44.96 KB (+0.17% 🔺)
@sentry/replay - Webpack (gzipped + minified) 38.85 KB (0%)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 63.86 KB (+0.13% 🔺)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 56.88 KB (+0.12% 🔺)

@@ -114,6 +114,8 @@ function applyClientOptions(event: Event, options: ClientOptions): void {
}
}

const debugIdStackParserCache = new Map<StackParser, Map<string, StackFrame[]>>();
Copy link
Member

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 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can!

Copy link
Member Author

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.

@lforst lforst requested a review from mydea April 12, 2023 14:36
@lforst lforst merged commit 970e108 into develop Apr 14, 2023
60 checks passed
@lforst lforst deleted the lforst-cache-processed-stacks branch April 14, 2023 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants