Skip to content

perf: add support for batched scope access - #2107

Open
jpnurmi wants to merge 3 commits into
masterfrom
jpnurmi/perf/scope-batch-update
Open

jpnurmi wants to merge 3 commits into
masterfrom
jpnurmi/perf/scope-batch-update

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Keep the scope read or write lock across a batch while allowing the owning thread to use existing scope accessors without relocking.

This tackles two use-cases:

  • Atomic reads of multiple scope properties: don't allow writes from other threads to intervene to ensure consistent data
  • Batched writes of multiple scope properties: one backend flush at the end can result in huge wins in terms of performance

@jpnurmi
jpnurmi force-pushed the jpnurmi/perf/scope-batch-update branch from 5593400 to a3ffce7 Compare September 17, 2026 14:08
@jpnurmi
jpnurmi added this pull request to stack #2092 September 17, 2026 14:08

@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.

Stale Bugbot comment from a previous run.

Comment thread src/sentry_scope.c
@jpnurmi
jpnurmi force-pushed the jpnurmi/perf/scope-batch-update branch from a3ffce7 to a38d913 Compare September 17, 2026 14:18
@jpnurmi
jpnurmi force-pushed the jpnurmi/perf/scope-batch-update branch from a38d913 to 41100bf Compare September 17, 2026 15:37
@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.07092% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.14%. Comparing base (6b0d5f0) to head (2c04bee).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2107      +/-   ##
==========================================
- Coverage   75.15%   75.14%   -0.02%     
==========================================
  Files         103      103              
  Lines       27930    28050     +120     
  Branches     5094     5112      +18     
==========================================
+ Hits        20990    21077      +87     
- Misses       5596     5624      +28     
- Partials     1344     1349       +5     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jpnurmi jpnurmi changed the title perf: add support for batched scope updates perf: add support for batched scope access Sep 18, 2026

@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 0083711. Configure here.

Comment thread src/sentry_scope.c
Comment thread src/sentry_scope.c
@jpnurmi
jpnurmi force-pushed the jpnurmi/perf/scope-batch-update branch from 0083711 to 3852ecb Compare September 18, 2026 14:48
Comment thread src/sentry_scope.c
@jpnurmi
jpnurmi force-pushed the jpnurmi/perf/scope-batch-update branch from 3852ecb to cef816a Compare September 19, 2026 18:53
Base automatically changed from jpnurmi/perf/global-scope-mutex to master September 20, 2026 06:28
Keep the scope write lock across a batch while allowing the owning thread
to use existing scope accessors without relocking. Defer backend scope
flushes until the outermost batch completes.
@jpnurmi
jpnurmi force-pushed the jpnurmi/perf/scope-batch-update branch from aeed6d1 to 2c04bee Compare September 20, 2026 06:28
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