Skip to content

[0.17] perf: read-write-locked scope data - #2042

Open
jpnurmi wants to merge 3 commits into
jpnurmi/perf/rwlockfrom
jpnurmi/perf/rwscope
Open

[0.17] perf: read-write-locked scope data#2042
jpnurmi wants to merge 3 commits into
jpnurmi/perf/rwlockfrom
jpnurmi/perf/rwscope

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Make sentry-native multi-threading friendly by allowing concurrent scope data readers. This removes the global scope mutex bottleneck from concurrent logs and metrics enrichment without changing public scope behavior.

Before

tests/benchmark.py::test_benchmark_logs[1] PASSED
Min 0.002ms, Max 0.002ms, Mean 0.002ms, Median 0.002ms, CPU 0.002ms                                                                                                                                                                                                                                      [ 25%]
tests/benchmark.py::test_benchmark_logs[8] PASSED
Min 0.026ms, Max 0.026ms, Mean 0.026ms, Median 0.026ms, CPU 0.008ms                                                                                                                                                                                                                                      [ 50%]
tests/benchmark.py::test_benchmark_logs[16] PASSED
Min 0.067ms, Max 0.067ms, Mean 0.067ms, Median 0.067ms, CPU 0.010ms                                                                                                                                                                                                                                      [ 75%]
tests/benchmark.py::test_benchmark_logs[32] PASSED
Min 0.121ms, Max 0.121ms, Mean 0.121ms, Median 0.121ms, CPU 0.010ms

After

tests/benchmark.py::test_benchmark_logs[1] PASSED
Min 0.004ms, Max 0.004ms, Mean 0.004ms, Median 0.004ms, CPU 0.004ms                                                                                                                                                                                                                                      [ 25%]
tests/benchmark.py::test_benchmark_logs[8] PASSED
Min 0.011ms, Max 0.011ms, Mean 0.011ms, Median 0.011ms, CPU 0.011ms                                                                                                                                                                                                                                      [ 50%]
tests/benchmark.py::test_benchmark_logs[16] PASSED
Min 0.024ms, Max 0.024ms, Mean 0.024ms, Median 0.024ms, CPU 0.022ms                                                                                                                                                                                                                                      [ 75%]
tests/benchmark.py::test_benchmark_logs[32] PASSED
Min 0.048ms, Max 0.048ms, Mean 0.048ms, Median 0.048ms, CPU 0.030ms

Close: #1862

@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 2 potential issues.

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 fcf63ce. Configure here.

Comment thread src/backends/sentry_backend_native.c
Comment thread src/sentry_core.c
@jpnurmi jpnurmi changed the title [0.17] ref: read-write-locked scope data [0.17] perf: read-write-locked scope data Sep 1, 2026
@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.03122% with 137 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.89%. Comparing base (219277a) to head (aab5243).

Additional details and impacted files
@@                   Coverage Diff                   @@
##           jpnurmi/perf/rwlock    #2042      +/-   ##
=======================================================
+ Coverage                74.50%   74.89%   +0.38%     
=======================================================
  Files                      103      103              
  Lines                    26920    27526     +606     
  Branches                  4880     5008     +128     
=======================================================
+ Hits                     20058    20615     +557     
- Misses                    5531     5576      +45     
- Partials                  1331     1335       +4     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jpnurmi jpnurmi mentioned this pull request Sep 2, 2026
17 tasks
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.

Logs: optimize performance

1 participant