sentry-java
sentry-java copied to clipboard
[SR] Introduce MapObjectReader
#skip-changelog
Add new sentry-android-replay module## :scroll: Description
- Extract an interface
ObjectReaderfromJsonObjecteReaderand introduce a newMapObjectReaderanalogous to what @markushi has done for the hybrid SDKs in https://github.com/getsentry/sentry-java/pull/2814- This is necessary to transform object from Maps to typed object for RRWebEvents since we hold a list of generics and lose their type at runtime.
- I also think this probably will be useful in the future if hybrid sdks will pass the data to the native ones in form of dictionaries (probably gonna be the case for Flutter session replay)
There are still some rough edges I believe, but it works for the current replay usecase, and I think it should be fine. I'll add some tests but won't cover everything (will fix stuff along-the-way if I find something).
:bulb: Motivation and Context
Next Steps
Add some tests for the MapObjectReader
Performance metrics :rocket:
| Plain | With Sentry | Diff | |
|---|---|---|---|
| Startup time | 356.45 ms | 440.81 ms | 84.36 ms |
| Size | 1.70 MiB | 2.28 MiB | 591.11 KiB |
Previous results on branch: rz/feat/session-replay-map-object-reader
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 6e79b82a3cf3ee04d56f46c49238e9855a412d5f | 354.06 ms | 437.15 ms | 83.09 ms |
| 8bd0d19603d2760fd17febcad32043e7c9629ce4 | 370.40 ms | 456.58 ms | 86.18 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 6e79b82a3cf3ee04d56f46c49238e9855a412d5f | 1.70 MiB | 2.28 MiB | 591.07 KiB |
| 8bd0d19603d2760fd17febcad32043e7c9629ce4 | 1.70 MiB | 2.28 MiB | 591.11 KiB |