Skip to content

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

Open
jpnurmi wants to merge 1 commit into
jpnurmi/ref/scope-datafrom
jpnurmi/perf/rwscope
Open

[WIP] perf: read-write-locked scope data#2042
jpnurmi wants to merge 1 commit into
jpnurmi/ref/scope-datafrom
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 87.26899% with 124 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.16%. Comparing base (1039e31) to head (a725ba4).

Additional details and impacted files
@@                    Coverage Diff                     @@
##           jpnurmi/ref/scope-data    #2042      +/-   ##
==========================================================
+ Coverage                   74.70%   75.16%   +0.45%     
==========================================================
  Files                         103      103              
  Lines                       27227    27629     +402     
  Branches                     4924     5041     +117     
==========================================================
+ Hits                        20341    20767     +426     
+ Misses                       5542     5520      -22     
+ Partials                     1344     1342       -2     
🚀 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
20 tasks
@jpnurmi
jpnurmi removed this pull request from stack #2010 September 9, 2026 10:32
@jpnurmi
jpnurmi added this pull request to stack #2080 September 9, 2026 10:32
@jpnurmi
jpnurmi removed this pull request from stack #2080 September 9, 2026 11:37
@jpnurmi jpnurmi changed the title [0.17] perf: read-write-locked scope data [WIP] perf: read-write-locked scope data Sep 9, 2026
Base automatically changed from jpnurmi/perf/rwlock to master September 9, 2026 19:42
@jpnurmi
jpnurmi force-pushed the jpnurmi/perf/rwscope branch from aab5243 to 03a2558 Compare September 9, 2026 19:53
@jpnurmi
jpnurmi changed the base branch from master to jpnurmi/ref/attachments September 9, 2026 19:53
@jpnurmi
jpnurmi added this pull request to stack #2082 September 9, 2026 19:54
@jpnurmi
jpnurmi force-pushed the jpnurmi/perf/rwscope branch 2 times, most recently from 8ed8d1c to a13e8c5 Compare September 10, 2026 11:51
@jpnurmi
jpnurmi removed this pull request from stack #2082 September 10, 2026 11:51
@jpnurmi
jpnurmi force-pushed the jpnurmi/perf/rwscope branch from a13e8c5 to a725ba4 Compare September 10, 2026 11:57
@jpnurmi
jpnurmi changed the base branch from jpnurmi/ref/attachments to jpnurmi/ref/scope-data September 10, 2026 11:58
@jpnurmi
jpnurmi added this pull request to stack #2084 September 10, 2026 11:58
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