Skip to content

ref(android): Remove unused lock from SentryPerformanceProvider - #5871

Merged
runningcode merged 2 commits into
mainfrom
no/remove-unused-lock-sentryperformanceprovider
Jul 30, 2026
Merged

ref(android): Remove unused lock from SentryPerformanceProvider#5871
runningcode merged 2 commits into
mainfrom
no/remove-unused-lock-sentryperformanceprovider

Conversation

@runningcode

@runningcode runningcode commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

📜 Description

Removes the unused AutoClosableReentrantLock field from SentryPerformanceProvider, and its now-unneeded import.

private final @NotNull AutoClosableReentrantLock lock = new AutoClosableReentrantLock();

The field was declared but never acquired. History:

💡 Motivation and Context

Delete dead code

💚 How did you test it?

it compiles

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

Notes on the checklist: no new tests were added — this removes dead code with no behavior to test, and the existing suite covers the class. A changelog entry is added under ### Performance.

🔮 Next steps

None.

The field was added in #3715 to guard onAppStartDone(), its only user. That
method was removed in the 8.x.x merge (#4033), leaving the lock orphaned — it
has been allocated on every cold start since, in ContentProvider.onCreate,
without ever being acquired.

The ISentryLifecycleToken import stays: it is still used for
AppStartMetrics.staticLock in shutdown().

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@sentry

sentry Bot commented Jul 30, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.51.0 (1) release

⚙️ sentry-android Build Distribution Settings

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 318.58 ms 377.00 ms 58.42 ms
Size 0 B 0 B 0 B

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
6b019b7 343.31 ms 417.23 ms 73.91 ms
d15471f 342.08 ms 415.44 ms 73.35 ms
8687935 332.52 ms 362.23 ms 29.71 ms
5b1a06b 352.27 ms 413.70 ms 61.43 ms
91bb874 314.47 ms 440.00 ms 125.53 ms
0ee65e9 321.06 ms 361.24 ms 40.18 ms
e63ad34 323.67 ms 390.33 ms 66.67 ms
33a08cc 267.08 ms 340.45 ms 73.37 ms
27d7cf8 397.90 ms 498.65 ms 100.75 ms
ee747ae 405.43 ms 485.70 ms 80.28 ms

App size

Revision Plain With Sentry Diff
6b019b7 0 B 0 B 0 B
d15471f 1.58 MiB 2.13 MiB 559.54 KiB
8687935 1.58 MiB 2.19 MiB 619.17 KiB
5b1a06b 0 B 0 B 0 B
91bb874 1.58 MiB 2.13 MiB 559.07 KiB
0ee65e9 0 B 0 B 0 B
e63ad34 0 B 0 B 0 B
33a08cc 1.58 MiB 2.12 MiB 555.28 KiB
27d7cf8 1.58 MiB 2.12 MiB 549.42 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB

Previous results on branch: no/remove-unused-lock-sentryperformanceprovider

Startup times

Revision Plain With Sentry Diff
71fb97a 317.00 ms 345.47 ms 28.47 ms

App size

Revision Plain With Sentry Diff
71fb97a 0 B 0 B 0 B

@runningcode
runningcode marked this pull request as ready for review July 30, 2026 08:47
@runningcode runningcode added the ship-it PR is ready to merge from a reviewer perspective label Jul 30, 2026

@romtsn romtsn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

:shipit:

@runningcode
runningcode enabled auto-merge (squash) July 30, 2026 08:49
@runningcode
runningcode merged commit 337a9f1 into main Jul 30, 2026
75 checks passed
@runningcode
runningcode deleted the no/remove-unused-lock-sentryperformanceprovider branch July 30, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ship-it PR is ready to merge from a reviewer perspective

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants