Skip to content

Conversation

mydea
Copy link
Member

@mydea mydea commented Sep 25, 2025

We use this instead of our own SyncPromise implementation where available. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/try for details.

trying out how that works first...

We use this instead of our own `SyncPromise` implementation where available.  See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/try for details.
@mydea mydea self-assigned this Sep 25, 2025
Copy link
Contributor

github-actions bot commented Sep 25, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.27 kB +0.08% +18 B 🔺
@sentry/browser - with treeshaking flags 22.78 kB +0.03% +6 B 🔺
@sentry/browser (incl. Tracing) 40.44 kB +0.02% +8 B 🔺
@sentry/browser (incl. Tracing, Replay) 78.81 kB -0.01% -1 B 🔽
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 68.48 kB -0.01% -2 B 🔽
@sentry/browser (incl. Tracing, Replay with Canvas) 83.48 kB +0.01% +6 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 95.69 kB +0.01% +7 B 🔺
@sentry/browser (incl. Feedback) 40.99 kB +0.05% +18 B 🔺
@sentry/browser (incl. sendFeedback) 28.93 kB +0.08% +21 B 🔺
@sentry/browser (incl. FeedbackAsync) 33.84 kB +0.01% +3 B 🔺
@sentry/react 25.99 kB +0.06% +14 B 🔺
@sentry/react (incl. Tracing) 42.43 kB +0.04% +15 B 🔺
@sentry/vue 28.77 kB -0.06% -15 B 🔽
@sentry/vue (incl. Tracing) 42.23 kB -0.03% -10 B 🔽
@sentry/svelte 24.29 kB +0.02% +4 B 🔺
CDN Bundle 25.78 kB +0.02% +4 B 🔺
CDN Bundle (incl. Tracing) 40.34 kB +0.02% +8 B 🔺
CDN Bundle (incl. Tracing, Replay) 76.59 kB +0.05% +37 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 82.08 kB +0.03% +24 B 🔺
CDN Bundle - uncompressed 75.41 kB +0.07% +46 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 119.43 kB +0.04% +46 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 234.56 kB +0.02% +46 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 247.32 kB +0.02% +46 B 🔺
@sentry/nextjs (client) 44.43 kB +0.01% +4 B 🔺
@sentry/sveltekit (client) 40.85 kB -0.01% -4 B 🔽
@sentry/node-core 50.04 kB +0.04% +20 B 🔺
@sentry/node 153.07 kB +0.01% +12 B 🔺
@sentry/node - without tracing 91.95 kB +0.01% +5 B 🔺
@sentry/aws-serverless 105.38 kB -0.01% -7 B 🔽

View base workflow run

Copy link
Contributor

github-actions bot commented Sep 25, 2025

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,740 - 8,396 +4%
GET With Sentry 1,325 15% 1,321 +0%
GET With Sentry (error only) 5,996 69% 5,768 +4%
POST Baseline 1,194 - 1,083 +10%
POST With Sentry 513 43% 463 +11%
POST With Sentry (error only) 1,024 86% 933 +10%
MYSQL Baseline 3,306 - 3,110 +6%
MYSQL With Sentry 406 12% 375 +8%
MYSQL With Sentry (error only) 2,644 80% 2,521 +5%

View base workflow run

@mydea
Copy link
Member Author

mydea commented Sep 26, 2025

Soo turns out we can't do this because it is not quite equivalent:

While Promise.try() executes the callback synchronously, then is still called asynchronously in the next tick. So the semantics for this change slightly, sadly.

@mydea mydea closed this Sep 26, 2025
mydea added a commit that referenced this pull request Sep 26, 2025
Extracted this out of
#17782, this improved
our promise buffer class a bit:

1. Remove the code path without a `limit`, as we never use this (there
is a default limit used). There is also really no reason to use this
without a limit, the limit is the whole purpose of this class.
2. Use a `Set` instead of an array for the internal buffer handling,
this should slightly streamline stuff.
3. For `drain`, we can simplify the implementation without a timeout
drastically. We can use `Promise.race()` to handle this more gracefully,
which should be supported everywhere.
4. Some slight refactorings, actually improving timing semantics
slightly.
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.

1 participant