sentry-react-native icon indicating copy to clipboard operation
sentry-react-native copied to clipboard

Use cached methods SentryDebugImageProvider of the Cocoa SDK

Open antonis opened this issue 1 year ago • 4 comments

:loudspeaker: Type of change

  • [x] Bugfix
  • [ ] New feature
  • [x] Enhancement
  • [ ] Refactoring

Depends on: https://github.com/getsentry/sentry-cocoa/pull/4460

:scroll: Description

Replaces getDebugImagesForAddresses:isCrash: with getDebugImagesForImageAddressesFromCache from https://github.com/getsentry/sentry-cocoa/pull/4435 to speed up getBinaryImages for finishing transactions and capturing events

:bulb: Motivation and Context

Fixes https://github.com/getsentry/sentry-react-native/issues/4169

:green_heart: How did you test it?

Manual tests, CI Added tests in https://github.com/getsentry/sentry-cocoa/pull/4460

:pencil: Checklist

  • [x] I reviewed submitted code
  • [x] I added tests to verify changes
  • [x] No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled
  • [x] All tests passing
  • [x] No breaking changes

:crystal_ball: Next steps

antonis avatar Oct 21 '24 08:10 antonis

Android (legacy) Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 442.96 ms 425.22 ms -17.74 ms
Size 17.74 MiB 20.08 MiB 2.34 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
c2a4e9b9386a596d6e84a9d857c77418388c0e5f 480.42 ms 485.60 ms 5.18 ms
4cc5c276b8e06761211f41601792dfcbfc7dd854 460.04 ms 496.32 ms 36.28 ms
0d3e6775185b3030074b2bca3cb796e5d265910b 422.82 ms 411.90 ms -10.92 ms
c639edf12520d1afee79e1ff2ba18df03ce70ec3 466.48 ms 489.57 ms 23.09 ms
d2c32bbdb8e91690865169f98c6ef7e2ed672df2 448.85 ms 450.19 ms 1.34 ms
ac41368cedb5f4e78bd1019e9a859ea193c3fb1a 451.47 ms 453.67 ms 2.20 ms
5bb8d5f7daec6cd95071caf511b5c2d4006a55ac 431.21 ms 459.40 ms 28.19 ms
5571a202e0c1fa9393e62c66ebd908444fee9c6e 410.55 ms 441.06 ms 30.51 ms
3853f4362ec819042552ffa9ed30e8f6627e60bf 329.68 ms 346.32 ms 16.64 ms
2ec71da2fbe36565c59c20f960c72fc75737275c 438.14 ms 460.46 ms 22.32 ms

App size

Revision Plain With Sentry Diff
c2a4e9b9386a596d6e84a9d857c77418388c0e5f 17.73 MiB 20.06 MiB 2.33 MiB
4cc5c276b8e06761211f41601792dfcbfc7dd854 17.73 MiB 19.95 MiB 2.21 MiB
0d3e6775185b3030074b2bca3cb796e5d265910b 17.74 MiB 20.07 MiB 2.34 MiB
c639edf12520d1afee79e1ff2ba18df03ce70ec3 17.74 MiB 20.08 MiB 2.34 MiB
d2c32bbdb8e91690865169f98c6ef7e2ed672df2 17.74 MiB 20.08 MiB 2.34 MiB
ac41368cedb5f4e78bd1019e9a859ea193c3fb1a 17.73 MiB 20.11 MiB 2.38 MiB
5bb8d5f7daec6cd95071caf511b5c2d4006a55ac 17.73 MiB 19.93 MiB 2.20 MiB
5571a202e0c1fa9393e62c66ebd908444fee9c6e 17.73 MiB 19.93 MiB 2.19 MiB
3853f4362ec819042552ffa9ed30e8f6627e60bf 17.73 MiB 19.81 MiB 2.08 MiB
2ec71da2fbe36565c59c20f960c72fc75737275c 17.73 MiB 20.10 MiB 2.37 MiB

Previous results on branch: antonis/4169-cocoa-DebugImagesFromCache

Startup times

Revision Plain With Sentry Diff
ff294e71e9b94e2fae6d0ef43b49780c52086586 491.08 ms 484.57 ms -6.51 ms
16c15ec30488c69158e0e5ddf2683b9277a46572 472.43 ms 479.40 ms 6.97 ms
2172ba1ba1557a5da27f950ca43a80dcb84d5aad 474.84 ms 471.14 ms -3.70 ms
addbb5756330d0782a275b8d6d96a265733a1d7c 456.54 ms 452.58 ms -3.96 ms

App size

Revision Plain With Sentry Diff
ff294e71e9b94e2fae6d0ef43b49780c52086586 17.74 MiB 20.08 MiB 2.34 MiB
16c15ec30488c69158e0e5ddf2683b9277a46572 17.74 MiB 20.07 MiB 2.34 MiB
2172ba1ba1557a5da27f950ca43a80dcb84d5aad 17.74 MiB 20.08 MiB 2.34 MiB
addbb5756330d0782a275b8d6d96a265733a1d7c 17.74 MiB 20.08 MiB 2.34 MiB

github-actions[bot] avatar Oct 21 '24 09:10 github-actions[bot]

iOS (legacy) Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 1238.80 ms 1238.78 ms -0.02 ms
Size 2.36 MiB 3.10 MiB 751.38 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
728164bd341a3b0e14876d86101c4bcca5b1f1ed+dirty 1256.10 ms 1259.08 ms 2.98 ms
dadc233f906b89b35cb320c3f7d1dfaf5db0cc5d+dirty 1223.20 ms 1236.88 ms 13.68 ms
52a80311c249f8c654de5d063c8be172a2dc9e5a+dirty 1280.88 ms 1289.78 ms 8.90 ms
12427f44d4b7746c431a369b538ec70ab2993c02+dirty 1267.15 ms 1271.30 ms 4.15 ms
d7401ac44acf524fe4d9a6a525f2cc13c70ce9e5+dirty 1252.38 ms 1275.04 ms 22.66 ms
148f9248007774c638943e03dc044cf71dec0c3d+dirty 1214.76 ms 1215.73 ms 0.97 ms
a989877aa578d652ec0683764d802bb6bb6cbd2e+dirty 1228.56 ms 1227.71 ms -0.85 ms
fe135918376819714679fec8bf2bb2e1f07ec64b+dirty 1208.25 ms 1219.53 ms 11.28 ms
484813b771d99e76c96e5cdea202fdc767bd7cf9+dirty 1222.45 ms 1220.79 ms -1.66 ms
ad6c2993f6b77abbcf4094d17dd1fa9f7742ae99+dirty 1244.76 ms 1260.10 ms 15.34 ms

App size

Revision Plain With Sentry Diff
728164bd341a3b0e14876d86101c4bcca5b1f1ed+dirty 2.36 MiB 2.88 MiB 530.38 KiB
dadc233f906b89b35cb320c3f7d1dfaf5db0cc5d+dirty 2.36 MiB 2.84 MiB 486.85 KiB
52a80311c249f8c654de5d063c8be172a2dc9e5a+dirty 2.36 MiB 2.82 MiB 469.44 KiB
12427f44d4b7746c431a369b538ec70ab2993c02+dirty 2.36 MiB 2.88 MiB 530.38 KiB
d7401ac44acf524fe4d9a6a525f2cc13c70ce9e5+dirty 2.36 MiB 2.83 MiB 481.14 KiB
148f9248007774c638943e03dc044cf71dec0c3d+dirty 2.36 MiB 3.04 MiB 696.25 KiB
a989877aa578d652ec0683764d802bb6bb6cbd2e+dirty 2.36 MiB 3.10 MiB 752.40 KiB
fe135918376819714679fec8bf2bb2e1f07ec64b+dirty 2.36 MiB 3.10 MiB 752.40 KiB
484813b771d99e76c96e5cdea202fdc767bd7cf9+dirty 2.36 MiB 3.08 MiB 734.18 KiB
ad6c2993f6b77abbcf4094d17dd1fa9f7742ae99+dirty 2.36 MiB 2.84 MiB 488.85 KiB

Previous results on branch: antonis/4169-cocoa-DebugImagesFromCache

Startup times

Revision Plain With Sentry Diff
16c15ec30488c69158e0e5ddf2683b9277a46572+dirty 1227.53 ms 1231.49 ms 3.96 ms
2172ba1ba1557a5da27f950ca43a80dcb84d5aad+dirty 1229.92 ms 1227.08 ms -2.84 ms
addbb5756330d0782a275b8d6d96a265733a1d7c+dirty 1232.02 ms 1239.22 ms 7.20 ms
ff294e71e9b94e2fae6d0ef43b49780c52086586+dirty 1233.35 ms 1235.80 ms 2.45 ms

App size

Revision Plain With Sentry Diff
16c15ec30488c69158e0e5ddf2683b9277a46572+dirty 2.36 MiB 3.08 MiB 734.95 KiB
2172ba1ba1557a5da27f950ca43a80dcb84d5aad+dirty 2.36 MiB 3.08 MiB 737.12 KiB
addbb5756330d0782a275b8d6d96a265733a1d7c+dirty 2.36 MiB 3.08 MiB 737.15 KiB
ff294e71e9b94e2fae6d0ef43b49780c52086586+dirty 2.36 MiB 3.08 MiB 735.60 KiB

github-actions[bot] avatar Oct 21 '24 09:10 github-actions[bot]

iOS (new) Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 1228.33 ms 1220.47 ms -7.86 ms
Size 2.92 MiB 3.66 MiB 755.55 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
728164bd341a3b0e14876d86101c4bcca5b1f1ed+dirty 1280.06 ms 1285.26 ms 5.20 ms
dadc233f906b89b35cb320c3f7d1dfaf5db0cc5d+dirty 1266.52 ms 1282.55 ms 16.03 ms
52a80311c249f8c654de5d063c8be172a2dc9e5a+dirty 1255.96 ms 1273.00 ms 17.04 ms
12427f44d4b7746c431a369b538ec70ab2993c02+dirty 1224.90 ms 1231.40 ms 6.50 ms
d7401ac44acf524fe4d9a6a525f2cc13c70ce9e5+dirty 1288.10 ms 1289.54 ms 1.44 ms
148f9248007774c638943e03dc044cf71dec0c3d+dirty 1220.72 ms 1221.30 ms 0.58 ms
a989877aa578d652ec0683764d802bb6bb6cbd2e+dirty 1222.90 ms 1219.89 ms -3.00 ms
fe135918376819714679fec8bf2bb2e1f07ec64b+dirty 1250.69 ms 1246.27 ms -4.43 ms
484813b771d99e76c96e5cdea202fdc767bd7cf9+dirty 1225.07 ms 1221.00 ms -4.07 ms
ad6c2993f6b77abbcf4094d17dd1fa9f7742ae99+dirty 1248.50 ms 1248.88 ms 0.38 ms

App size

Revision Plain With Sentry Diff
728164bd341a3b0e14876d86101c4bcca5b1f1ed+dirty 2.92 MiB 3.44 MiB 533.26 KiB
dadc233f906b89b35cb320c3f7d1dfaf5db0cc5d+dirty 2.92 MiB 3.40 MiB 492.53 KiB
52a80311c249f8c654de5d063c8be172a2dc9e5a+dirty 2.92 MiB 3.38 MiB 475.71 KiB
12427f44d4b7746c431a369b538ec70ab2993c02+dirty 2.92 MiB 3.44 MiB 533.29 KiB
d7401ac44acf524fe4d9a6a525f2cc13c70ce9e5+dirty 2.92 MiB 3.40 MiB 488.06 KiB
148f9248007774c638943e03dc044cf71dec0c3d+dirty 2.92 MiB 3.60 MiB 701.88 KiB
a989877aa578d652ec0683764d802bb6bb6cbd2e+dirty 2.92 MiB 3.66 MiB 757.66 KiB
fe135918376819714679fec8bf2bb2e1f07ec64b+dirty 2.92 MiB 3.66 MiB 757.71 KiB
484813b771d99e76c96e5cdea202fdc767bd7cf9+dirty 2.92 MiB 3.64 MiB 740.56 KiB
ad6c2993f6b77abbcf4094d17dd1fa9f7742ae99+dirty 2.92 MiB 3.40 MiB 494.12 KiB

Previous results on branch: antonis/4169-cocoa-DebugImagesFromCache

Startup times

Revision Plain With Sentry Diff
16c15ec30488c69158e0e5ddf2683b9277a46572+dirty 1244.35 ms 1249.24 ms 4.89 ms
2172ba1ba1557a5da27f950ca43a80dcb84d5aad+dirty 1219.27 ms 1214.83 ms -4.44 ms
addbb5756330d0782a275b8d6d96a265733a1d7c+dirty 1239.21 ms 1237.73 ms -1.47 ms
ff294e71e9b94e2fae6d0ef43b49780c52086586+dirty 1242.11 ms 1237.53 ms -4.58 ms

App size

Revision Plain With Sentry Diff
16c15ec30488c69158e0e5ddf2683b9277a46572+dirty 2.92 MiB 3.64 MiB 740.58 KiB
2172ba1ba1557a5da27f950ca43a80dcb84d5aad+dirty 2.92 MiB 3.64 MiB 743.02 KiB
addbb5756330d0782a275b8d6d96a265733a1d7c+dirty 2.92 MiB 3.64 MiB 742.91 KiB
ff294e71e9b94e2fae6d0ef43b49780c52086586+dirty 2.92 MiB 3.64 MiB 741.28 KiB

github-actions[bot] avatar Oct 21 '24 09:10 github-actions[bot]

Android (new) Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 398.63 ms 495.71 ms 97.08 ms
Size 7.15 MiB 8.35 MiB 1.20 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
ac41368cedb5f4e78bd1019e9a859ea193c3fb1a+dirty 395.91 ms 451.17 ms 55.26 ms
42973249f25bb547cf943daec67008271e93c69c+dirty 385.33 ms 435.68 ms 50.35 ms
d8668ce6d58c13991a0d6bfa0c9fea640a933376+dirty 372.43 ms 403.84 ms 31.41 ms
e2b64fed057d4b01cf7ad79eb19eb3c8b8002a82+dirty 258.82 ms 304.26 ms 45.44 ms
544699261cd72e3efc1259ba66b138f5f70a05ed+dirty 371.61 ms 390.00 ms 18.39 ms
a989877aa578d652ec0683764d802bb6bb6cbd2e+dirty 383.04 ms 400.92 ms 17.88 ms
9cab16b4cf2602d7dbadc465c56c004fe1248021+dirty 370.82 ms 416.37 ms 45.55 ms
4a6664fa7140687cfa079f2d738b59b18e4ac7b7+dirty 357.02 ms 394.91 ms 37.89 ms
e5bc97b850117530a0b5a1fd7728fcf3909efb04+dirty 409.10 ms 471.61 ms 62.51 ms
700cbf4afb71e75ce0939b98522893b4ae61d70b+dirty 411.71 ms 485.52 ms 73.81 ms

App size

Revision Plain With Sentry Diff
ac41368cedb5f4e78bd1019e9a859ea193c3fb1a+dirty 7.15 MiB 8.39 MiB 1.24 MiB
42973249f25bb547cf943daec67008271e93c69c+dirty 7.15 MiB 8.35 MiB 1.20 MiB
d8668ce6d58c13991a0d6bfa0c9fea640a933376+dirty 7.15 MiB 8.35 MiB 1.20 MiB
e2b64fed057d4b01cf7ad79eb19eb3c8b8002a82+dirty 7.15 MiB 8.07 MiB 947.16 KiB
544699261cd72e3efc1259ba66b138f5f70a05ed+dirty 7.15 MiB 8.12 MiB 999.45 KiB
a989877aa578d652ec0683764d802bb6bb6cbd2e+dirty 7.15 MiB 8.35 MiB 1.20 MiB
9cab16b4cf2602d7dbadc465c56c004fe1248021+dirty 7.15 MiB 8.35 MiB 1.20 MiB
4a6664fa7140687cfa079f2d738b59b18e4ac7b7+dirty 7.15 MiB 8.22 MiB 1.07 MiB
e5bc97b850117530a0b5a1fd7728fcf3909efb04+dirty 7.15 MiB 8.35 MiB 1.20 MiB
700cbf4afb71e75ce0939b98522893b4ae61d70b+dirty 7.15 MiB 8.34 MiB 1.19 MiB

Previous results on branch: antonis/4169-cocoa-DebugImagesFromCache

Startup times

Revision Plain With Sentry Diff
ff294e71e9b94e2fae6d0ef43b49780c52086586+dirty 454.54 ms 535.50 ms 80.96 ms
2172ba1ba1557a5da27f950ca43a80dcb84d5aad+dirty 371.50 ms 418.29 ms 46.79 ms
16c15ec30488c69158e0e5ddf2683b9277a46572+dirty 396.57 ms 445.69 ms 49.13 ms
addbb5756330d0782a275b8d6d96a265733a1d7c+dirty 397.27 ms 465.31 ms 68.04 ms

App size

Revision Plain With Sentry Diff
ff294e71e9b94e2fae6d0ef43b49780c52086586+dirty 7.15 MiB 8.35 MiB 1.20 MiB
2172ba1ba1557a5da27f950ca43a80dcb84d5aad+dirty 7.15 MiB 8.35 MiB 1.20 MiB
16c15ec30488c69158e0e5ddf2683b9277a46572+dirty 7.15 MiB 8.35 MiB 1.20 MiB
addbb5756330d0782a275b8d6d96a265733a1d7c+dirty 7.15 MiB 8.35 MiB 1.20 MiB

github-actions[bot] avatar Oct 21 '24 10:10 github-actions[bot]

Does this PR depend on the new cocoa release before being merge? if so I would add an label blocked on it. Otherwise, the PR looks good to me!

lucas-zimerman avatar Oct 30 '24 13:10 lucas-zimerman

Thank you for reviewing @lucas-zimerman 🙇

Does this PR depend on the new cocoa release before being merge?

At the current state the PR does not depend on a future Cocoa release. I've added a note though to remove the private method declaration when the new hybrid sdk header get's released in Cocoa. I think this can be done in another PR when Cocoa 8.40 is out.

antonis avatar Oct 30 '24 13:10 antonis

At the current state the PR does not depend on a future Cocoa release. I've https://github.com/getsentry/sentry-react-native/pull/4194#discussion_r1820459792 to remove the private method declaration when the new hybrid sdk header get's released in Cocoa. I think this can be done in another PR when Cocoa 8.40 is out.

With Cocoa 8.40.0 merged I removed the private function declaration (48fdebdb1a6f068fbcbcba026dbd43f4bdc60e94). Ready for another pass.

antonis avatar Nov 07 '24 09:11 antonis