Skip to content

A drop in simultaneous requests per seconds with Bun when Sentry is active #12561

Closed as not planned

Description

@riepspellz

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

8.10.0

Framework Version

Bun 1.1.14

Link to Sentry event

No response

SDK Setup

import { init } from "@sentry/bun";

init({
	dsn: process.env.SENTRY_DSN
});

Steps to Reproduce

  1. Compile your app and launch a stress test (bombardier 100 concurrent, 1 million requests) on a simple route
    [https://github.com/codesenberg/bombardier](Bombardier link)
    Command: bombardier -c 100 -n 1000000 http://localhost:8080/stress
  2. Put your dsn in the Sentry.init as undefined
  3. Recompile your app and relaunch the same stress test

FYI: I just convert my Typescript Express APP CJS into a fully ESM Express app, builded with esbuild and powered by Bun.
After that, i wanted to check the effective gain of this conversion with some stress test.

In my CJS Node app, there's a small difference with or without Sentry:
Average of 18190.75 requests seconds with Sentry
Average of 19211.16 requests seconds without

Screenshot 2024-06-19 at 15 40 12

In node i was using the 8.8.0 version of @sentry/node.

Expected Result

Approximatively the same requests/seconds

Actual Result

~54 % less requests/seconds

Screenshot 2024-06-19 at 15 35 40

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jun 19, 2024
  2. changed the title [-]A drop of simultaneous requests per seconds with Bun when Sentry is active[/-] [+]A drop in simultaneous requests per seconds with Bun when Sentry is active[/+] on Jun 19, 2024
  3. AbhiPrasad commented on Jun 19, 2024

    @AbhiPrasad
    Contributor

    @riepspellz if you add skipOpenTelemetrySetup: true to your Sentry.init call do you see similar performance problems?

    If you use @sentry/node instead of @sentry/bun (top-level API should be identical), do you see similar performance issues?

  4. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jun 19, 2024
  5. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jun 19, 2024
  6. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jun 19, 2024
  7. riepspellz commented on Jun 19, 2024

    @riepspellz
    Author

    @riepspellz if you add skipOpenTelemetrySetup: true to your Sentry.init call do you see similar performance problems?

    If you use @sentry/node instead of @sentry/bun (top-level API should be identical), do you see similar performance issues?

    Hello @AbhiPrasad ,

    It seems to work !

    Passing to @sentry/node makes me go to 47426.66 requests per seconds instead of 31048 requests per seconds. Same result with or without skipOpenTelemetrySetup: true

    In the other hand, if keep @sentry/bun and i put skipOpenTelemetrySetup: true, the init function doesn't recognise it (TS interface not implemented yet ?), but it improve the results, from 31048 requests per seconds to 38775.97 requests per seconds.

    For now, i will use @sentry/node, thanks for the tip !

  8. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jun 19, 2024
  9. AbhiPrasad commented on Jun 19, 2024

    @AbhiPrasad
    Contributor

    okay so this is something with our Bun instrumentation then!

    I'm going to backlog this, but any kind of profile of a request with the Bun SDK active would be a big help in us understanding the performance differences!

  10. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jun 19, 2024
  11. lforst commented on Mar 3, 2025

    @lforst
    Contributor

    Closing this due to inactivity. If we get a memory profile we can take another look.

  12. ghost added on Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions