Skip to content

ref(node): store split file in cache for contextlines - #7383

Merged
JonasBa merged 3 commits into
developfrom
ref/perf/contextlines-file
Mar 8, 2023
Merged

ref(node): store split file in cache for contextlines#7383
JonasBa merged 3 commits into
developfrom
ref/perf/contextlines-file

Conversation

@JonasBa

Copy link
Copy Markdown
Contributor

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
JonasBaforce-pushed the ref/perf/contextlines-file branch from 8271990 to 18eb932CompareMarch 8, 2023 15:41
@AbhiPrasadAbhiPrasad changed the title ref(contextlines): store split file in cacheref(node): store split file in cache for contextlinesMar 8, 2023
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
@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 developMar 8, 2023
@JonasBa
JonasBa deleted the ref/perf/contextlines-file branch March 8, 2023 23:52
Sign up for freeto 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.

3 participants

@JonasBa@timfish@AbhiPrasad