Skip to content

Conversation

@Lms24
Copy link
Member

@Lms24 Lms24 commented Jan 7, 2026

A conversation about browser performance.timeOrigin (cc @timfish) made me take a look at our implementation how to get the most accurate time origin. I'm fairly sure this implementation has a few flaws we should fix but for the scope of this PR I decided to add test coverage and apply some slight bundle size savings first, before tackling them.

Specifically, this PR:

  • Removes a couple of bytes, by no longer storing the source of the timeOrigin. While this would be arguably valuable, we never used this information, so right now it was just wasted space. If we ever need it, we can bring it back of course)
  • Adds tests for the time origin determination, reliability testing and fallback logic
  • Adds TODOs for future improvements. Some of them we can tackle directly, but I want to have them in independent PRs to be able to revert them easily.

Blocked on major: We can remove an entire branch of this code, if we decide to drop Safari 14 support (opened #18707 to track)

@Lms24 Lms24 self-assigned this Jan 7, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.84 kB - -
@sentry/browser - with treeshaking flags 23.34 kB - -
@sentry/browser (incl. Tracing) 41.6 kB -0.05% -17 B 🔽
@sentry/browser (incl. Tracing, Profiling) 46.2 kB -0.04% -17 B 🔽
@sentry/browser (incl. Tracing, Replay) 80.17 kB -0.02% -16 B 🔽
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 69.91 kB -0.03% -20 B 🔽
@sentry/browser (incl. Tracing, Replay with Canvas) 84.86 kB -0.02% -16 B 🔽
@sentry/browser (incl. Tracing, Replay, Feedback) 97.11 kB -0.03% -20 B 🔽
@sentry/browser (incl. Feedback) 41.57 kB - -
@sentry/browser (incl. sendFeedback) 29.53 kB - -
@sentry/browser (incl. FeedbackAsync) 34.53 kB - -
@sentry/browser (incl. Metrics) 25.85 kB - -
@sentry/browser (incl. Logs) 26.07 kB - -
@sentry/browser (incl. Metrics & Logs) 26.82 kB - -
@sentry/react 26.58 kB - -
@sentry/react (incl. Tracing) 43.83 kB -0.04% -17 B 🔽
@sentry/vue 29.3 kB - -
@sentry/vue (incl. Tracing) 43.42 kB -0.05% -18 B 🔽
@sentry/svelte 24.86 kB - -
CDN Bundle 27.26 kB - -
CDN Bundle (incl. Tracing) 42.25 kB -0.05% -17 B 🔽
CDN Bundle (incl. Tracing, Replay) 78.96 kB -0.03% -18 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) 84.43 kB -0.02% -15 B 🔽
CDN Bundle - uncompressed 80.02 kB - -
CDN Bundle (incl. Tracing) - uncompressed 125.41 kB -0.04% -45 B 🔽
CDN Bundle (incl. Tracing, Replay) - uncompressed 241.95 kB -0.02% -45 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 254.74 kB -0.02% -45 B 🔽
@sentry/nextjs (client) 46.19 kB -0.05% -20 B 🔽
@sentry/sveltekit (client) 41.97 kB -0.05% -17 B 🔽
@sentry/node-core 51.69 kB - -
@sentry/node 161.61 kB +0.01% +1 B 🔺
@sentry/node - without tracing 93.13 kB - -
@sentry/aws-serverless 108.64 kB +0.01% +1 B 🔺

View base workflow run

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 11,614 - 9,110 +27%
GET With Sentry 1,951 17% 1,662 +17%
GET With Sentry (error only) 7,817 67% 5,925 +32%
POST Baseline 1,180 - 1,170 +1%
POST With Sentry 590 50% 560 +5%
POST With Sentry (error only) 1,048 89% 1,033 +1%
MYSQL Baseline 4,099 - 3,189 +29%
MYSQL With Sentry 475 12% 397 +20%
MYSQL With Sentry (error only) 3,371 82% 2,590 +30%

View base workflow run

Copy link
Collaborator

@logaretm logaretm left a comment

Choose a reason for hiding this comment

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

Nice!

@Lms24 Lms24 merged commit a6a4f7b into develop Jan 7, 2026
405 of 407 checks passed
@Lms24 Lms24 deleted the lms/ref-core-optimize-timeOrigin branch January 7, 2026 13:27
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