Skip to content

Reducing writes performed by the PersistingScopeObserver #3168

@sam-step

Description

@sam-step

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

In some flows where we’re logging a fair amount (and therefore creating many breadcrumbs), these add up and noticeably affect performance.

My understanding is this writing of breadcrumb entries to disk is just for ANR detection and, today, there is no way to disable this behavior without disabling all caching, which may affect other features.

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

Solution Brainstorm

No response

Metadata

Metadata

Assignees

Labels

Projects

Status

Done

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions