Skip to content

Conversation

@lforst
Copy link
Contributor

@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 requested review from AbhiPrasad and mitsuhiko April 12, 2023 11:19
@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% 🔺)

}
}

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
Contributor 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
Contributor 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
@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.

4 participants