Skip to content

perf(native): load libcurl lazily in crash daemon - #1955

Open
jpnurmi wants to merge 3 commits into
jpnurmi/feat/curl-link-optionfrom
jpnurmi/perf/native-daemon-curl
Open

perf(native): load libcurl lazily in crash daemon#1955
jpnurmi wants to merge 3 commits into
jpnurmi/feat/curl-link-optionfrom
jpnurmi/perf/native-daemon-curl

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Default the Native Unix crash daemon to runtime libcurl loading when SENTRY_LINK_CURL is not explicitly set. Keep explicit SENTRY_LINK_CURL=ON/OFF respected for the daemon. This lets sentry-crash avoid a direct libcurl dependency by default while the SDK continues to link libcurl directly unless configured otherwise.

Signal readiness to the parent process before starting the daemon transport. This keeps libcurl loading and curl transport initialization out of the startup handshake, while still starting the transport before the daemon enters its crash wait loop.

Important

Native/Unix daemon readiness now means the daemon IPC is ready, not that the HTTP transport has already been started. The daemon signals readiness to the parent first, then starts the transport immediately afterward. In practice, this keeps app startup from waiting on libcurl loading/initialization while preserving normal daemon-side sending once startup continues.

This shaves off ~50% startup time on Linux.

Before:

tests/benchmark.py::test_benchmark_init[native] PASSED
Min 9.189ms, Max 13.951ms, Mean 11.242ms, StdDev 1.806ms, Median 11.061ms, CPU 5.082ms
tests/benchmark.py::test_benchmark_backend[native] PASSED
Min 11.187ms, Max 13.468ms, Mean 12.581ms, StdDev 0.952ms, Median 12.821ms, CPU 5.773ms

After:

tests/benchmark.py::test_benchmark_init[native] PASSED
Min 4.384ms, Max 6.821ms, Mean 5.262ms, StdDev 1.083ms, Median 4.732ms, CPU 3.821ms
tests/benchmark.py::test_benchmark_backend[native] PASSED
Min 4.067ms, Max 5.052ms, Mean 4.438ms, StdDev 0.386ms, Median 4.341ms, CPU 3.282ms

See:

Comment thread src/backends/native/sentry_crash_daemon.c
@jpnurmi
jpnurmi force-pushed the jpnurmi/perf/native-daemon-curl branch from ce91251 to d242d0b Compare August 4, 2026 19:39
Comment thread CMakeLists.txt Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d242d0b. Configure here.

Comment thread CMakeLists.txt
@jpnurmi
jpnurmi force-pushed the jpnurmi/perf/native-daemon-curl branch from d242d0b to a0b4478 Compare August 4, 2026 19:50
@jpnurmi
jpnurmi force-pushed the jpnurmi/perf/native-daemon-curl branch from a0b4478 to 9c02684 Compare August 4, 2026 19:53
@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.85%. Comparing base (91ab69f) to head (8fc3b36).
⚠️ Report is 1 commits behind head on jpnurmi/feat/curl-link-option.

Additional details and impacted files
@@                        Coverage Diff                        @@
##           jpnurmi/feat/curl-link-option    #1955      +/-   ##
=================================================================
+ Coverage                          67.94%   75.85%   +7.91%     
=================================================================
  Files                                 91       94       +3     
  Lines                              21607    22246     +639     
  Branches                            3843     3962     +119     
=================================================================
+ Hits                               14681    16875    +2194     
+ Misses                              4952     4463     -489     
+ Partials                            1974      908    -1066     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jpnurmi
jpnurmi force-pushed the jpnurmi/perf/native-daemon-curl branch from 9c02684 to f59b6a8 Compare August 5, 2026 08:07
jpnurmi added 3 commits August 5, 2026 16:48
Default the Native Unix crash daemon to runtime libcurl loading when
SENTRY_LINK_CURL=AUTO. Keep explicit SENTRY_LINK_CURL=ON/OFF respected for
the daemon.

This lets sentry-crash avoid a direct libcurl dependency by default while the
SDK continues to link libcurl directly unless configured otherwise.

See: #1852
Signal readiness to the parent process before starting the daemon transport.
This keeps libcurl loading and curl transport initialization out of the
startup handshake, while still starting the transport before the daemon enters
its crash wait loop.

See: #1852
@jpnurmi
jpnurmi force-pushed the jpnurmi/perf/native-daemon-curl branch from f59b6a8 to 8fc3b36 Compare August 5, 2026 14:49
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