Skip to content

Conversation

@JonasBa
Copy link
Member

@JonasBa JonasBa commented Mar 8, 2023

We were storing the file as a raw string in cache and performing the .split(\n) inside our for(frame of frames) loop... This means that for stack traces with functions belonging to the same file, the file was split multiple times - this is inefficient and we can do better by storing the file as it's split version in cache and avoiding the unnecessary duplicate split operations.

@JonasBa JonasBa requested review from AbhiPrasad and timfish March 8, 2023 15:37
@JonasBa JonasBa force-pushed the ref/perf/contextlines-file branch from 8271990 to 18eb932 Compare March 8, 2023 15:41
@AbhiPrasad AbhiPrasad changed the title ref(contextlines): store split file in cache ref(node): store split file in cache for contextlines Mar 8, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2023

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 20.15 KB (+0.16% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 62.63 KB (+0.18% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.79 KB (+0.16% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 55.61 KB (+0.21% 🔺)
@sentry/browser - Webpack (gzipped + minified) 20.53 KB (+0.18% 🔺)
@sentry/browser - Webpack (minified) 67.1 KB (+0.17% 🔺)
@sentry/react - Webpack (gzipped + minified) 20.56 KB (+0.17% 🔺)
@sentry/nextjs Client - Webpack (gzipped + minified) 48.3 KB (+0.07% 🔺)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 27.29 KB (+0.11% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 25.55 KB (+0.14% 🔺)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 43.15 KB (+0.08% 🔺)
@sentry/replay - Webpack (gzipped + minified) 37.16 KB (0%)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 60.94 KB (+0.06% 🔺)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 54.26 KB (+0.06% 🔺)

@JonasBa JonasBa merged commit 486d4be into develop Mar 8, 2023
@JonasBa JonasBa deleted the ref/perf/contextlines-file branch March 8, 2023 23:52
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