Skip to content

Conversation

@Lms24
Copy link
Member

@Lms24 Lms24 commented Jan 7, 2026

This PR fixes a "bug" where we previously returned just Date.now() as a fallback for getting the timeOrigin if more precise performance.timeOrigin or performance.timing.navigationStart were not available or unreliable.

This fix now subtracts performance.now() from Date.now() which should make the fallback more accurate.

Closes #18716 (added automatically)

@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 8,771 - 9,520 -8%
GET With Sentry 1,705 19% 1,766 -3%
GET With Sentry (error only) 5,986 68% 6,208 -4%
POST Baseline 1,168 - 1,177 -1%
POST With Sentry 595 51% 592 +1%
POST With Sentry (error only) 1,048 90% 1,062 -1%
MYSQL Baseline 3,313 - 3,378 -2%
MYSQL With Sentry 404 12% 462 -13%
MYSQL With Sentry (error only) 2,612 79% 2,746 -5%

View base workflow run

@Lms24 Lms24 merged commit a68ac90 into develop Jan 7, 2026
210 checks passed
@Lms24 Lms24 deleted the lms/fix-core-timeOrigin-fallback branch January 7, 2026 15:41
Lms24 added a commit that referenced this pull request Jan 8, 2026
#18719)

In `browserPerformanceTimeOrigin`, we test how reliable
`performance.timeOrigin` (or its predecessor) is by comparing its
timestamp against `performance.now() - Date.now()`. If the delta is
larger than 1h, we take the fallback rather than
`performance.timeOrigin`.

This PR now makes the reliability check more strict by decreasing the
time window from 1h to just 5 minutes. This _should_ catch time drift
more often. Now that we improved the fallback via #18715, I think we can
give this a shot.
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.

fix(core): Subtract performance.now() from browserPerformanceTimeOrigin fallback

4 participants