Title: Reducing writes performed by the PersistingScopeObserver · Issue #3168 · getsentry/sentry-java · GitHub
Open Graph Title: Reducing writes performed by the PersistingScopeObserver · Issue #3168 · getsentry/sentry-java
X Title: Reducing writes performed by the PersistingScopeObserver · Issue #3168 · getsentry/sentry-java
Description: Problem Statement Hello, I’m looking into CPU usage of our Android React Native app and noticed we’re spending an unexpectedly large amount of time converting breadcrumb records to JSON and persisting them. From what I can tell, the Pers...
Open Graph Description: Problem Statement Hello, I’m looking into CPU usage of our Android React Native app and noticed we’re spending an unexpectedly large amount of time converting breadcrumb records to JSON and persist...
X Description: Problem Statement Hello, I’m looking into CPU usage of our Android React Native app and noticed we’re spending an unexpectedly large amount of time converting breadcrumb records to JSON and persist...
Opengraph URL: https://github.com/getsentry/sentry-java/issues/3168
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Reducing writes performed by the PersistingScopeObserver","articleBody":"### Problem Statement\n\nHello, I’m looking into CPU usage of our Android React Native app and noticed we’re spending an unexpectedly large amount of time converting breadcrumb records to JSON and persisting them.\r\n\r\nFrom what I can tell, the [PersistingScopeObserver](https://github.com/getsentry/sentry-java/blob/main/sentry/src/main/java/io/sentry/cache/PersistingScopeObserver.java) will delete and re-write the entire breadcrumb cache (by default up to 100 records) of the current Scope any time a new breadcrumb is added.\r\n\r\nIn some flows where we’re logging a fair amount (and therefore creating many breadcrumbs), these add up and noticeably affect performance.\r\n\r\nMy understanding is this writing of breadcrumb entries to disk is just for [ANR detection](https://github.com/getsentry/sentry-java/pull/2697) and, today, there is no way to disable this behavior without disabling all caching, which may affect other features.\r\n\r\nAssuming my understanding is correct, is there an appetite to make this behavior configurable (supporting batching writes, or even disabling writes, etc)? For our usecase, this is an instance where we’re happy to lose a bit of observability to retain performance.\n\n### Solution Brainstorm\n\n_No response_","author":{"url":"https://github.com/sam-step","@type":"Person","name":"sam-step"},"datePublished":"2024-01-26T01:09:16Z","url":"https://github.com/getsentry/sentry-java/issues/3168"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:87f33b3d-43d9-5d5d-9719-373a3b36b4da |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BC1C:1FAF:183BE85:2077F5B:6B04321E |
| html-safe-nonce | 35e9970d6077e1c56d2fb49564bf5b590228c7071c82f68d0a0e1cf730762585 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzFDOjFGQUY6MTgzQkU4NToyMDc3RjVCOjZCMDQzMjFFIiwidmlzaXRvcl9pZCI6IjM1NjA5NzEyMjUyOTM2NjQ3OTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6c105a6e514cbbab24047f6be67e01b2937c626049dbcc24b43bd104792603c3 |
| hovercard-subject-tag | issue:2101415862 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-java/3168/issue_layout |
| twitter:image | https://opengraph.githubassets.com/587d503bef25302efadce6ff1623c497f21edc9a0dc58115ffe637f995fd7562/getsentry/sentry-java/issues/3168 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/587d503bef25302efadce6ff1623c497f21edc9a0dc58115ffe637f995fd7562/getsentry/sentry-java/issues/3168 |
| og:image:alt | Problem Statement Hello, I’m looking into CPU usage of our Android React Native app and noticed we’re spending an unexpectedly large amount of time converting breadcrumb records to JSON and persist... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sam-step |
| hostname | github.com |
| expected-hostname | github.com |
| None | b7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-java git https://github.com/getsentry/sentry-java.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3368190 |
| octolytics-dimension-repository_nwo | getsentry/sentry-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3368190 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c3dd496c3da6ea6b77e69c09279d2b81604654f1 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width