-
-
Notifications
You must be signed in to change notification settings - Fork 372
impr: Speed up getBinaryImages #4435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add two new internal methods getDebugImagesFromCacheForFrames getDebugImagesFromCacheFrames to the SentryDebugImageProvider which use the significantly faster SentryBinaryImageCache. Fixes GH-4399
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4435 +/- ##
=============================================
+ Coverage 91.319% 91.333% +0.013%
=============================================
Files 610 610
Lines 49755 49926 +171
Branches 17928 18037 +109
=============================================
+ Hits 45436 45599 +163
- Misses 4227 4234 +7
- Partials 92 93 +1
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 7cd187e | 1239.02 ms | 1261.42 ms | 22.40 ms |
| 9fa5d27 | 1230.65 ms | 1255.08 ms | 24.43 ms |
| f1ed6f8 | 1210.94 ms | 1230.78 ms | 19.84 ms |
| 5b888cb | 1218.28 ms | 1244.65 ms | 26.37 ms |
| 8aec30e | 1235.73 ms | 1255.87 ms | 20.14 ms |
| 326b7eb | 1223.41 ms | 1235.66 ms | 12.25 ms |
| 1c0e955 | 1275.71 ms | 1305.69 ms | 29.98 ms |
| 5e769dd | 1216.24 ms | 1245.74 ms | 29.50 ms |
| 282cc99 | 1232.59 ms | 1245.88 ms | 13.29 ms |
| 8f397a7 | 1196.55 ms | 1226.82 ms | 30.27 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 7cd187e | 20.76 KiB | 401.65 KiB | 380.89 KiB |
| 9fa5d27 | 20.76 KiB | 393.37 KiB | 372.61 KiB |
| f1ed6f8 | 21.58 KiB | 683.51 KiB | 661.93 KiB |
| 5b888cb | 21.58 KiB | 654.67 KiB | 633.09 KiB |
| 8aec30e | 21.58 KiB | 616.75 KiB | 595.17 KiB |
| 326b7eb | 20.76 KiB | 432.31 KiB | 411.55 KiB |
| 1c0e955 | 21.58 KiB | 424.28 KiB | 402.70 KiB |
| 5e769dd | 21.58 KiB | 572.21 KiB | 550.62 KiB |
| 282cc99 | 22.85 KiB | 414.09 KiB | 391.24 KiB |
| 8f397a7 | 20.76 KiB | 420.55 KiB | 399.79 KiB |
Previous results on branch: impr/speed-up-get-debug-images
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 5096089 | 1214.55 ms | 1239.74 ms | 25.19 ms |
| cb282da | 1237.39 ms | 1259.47 ms | 22.08 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 5096089 | 21.58 KiB | 707.35 KiB | 685.77 KiB |
| cb282da | 21.58 KiB | 707.35 KiB | 685.77 KiB |
brustolin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Follow up on GH-4435. Use binary image cache to get debug meta when finishing the tracer and capturing profiles. Mark all methods to get debug meta not using the cache as deprecated to ensure we migrate to the methods using the cache.
Follow up on GH-4435. Use binary image cache to get debug meta when finishing the tracer and capturing profiles. Mark all methods to get debug meta not using the cache as deprecated to ensure we migrate to the methods using the cache.
📜 Description
Add two new internal methods
getDebugImagesFromCacheForFramesandgetDebugImagesFromCacheForThreadsto theSentryDebugImageProvider, which use the significantly fasterSentryBinaryImageCache.sentry-cocoa/Sources/Sentry/include/HybridPublic/SentryBinaryImageCache.h
Lines 11 to 16 in 5a6e387
💡 Motivation and Context
Fixes GH-4399
💚 How did you test it?
Will test it with TestFlight builds.
Main Branch
Event in Sentry
Debug Meta Event JSON
{ "code_file": "/private/var/containers/Bundle/Application/62D5E98F-1727-439B-AEC8-6DD71F97B71D/iOS-Swift.app/iOS-Swift", "debug_id": "289a8392-886c-302a-991e-3577820b1c48", "arch": "arm64", "image_addr": "0x104e58000", "image_size": 262144, "image_vmaddr": "0x100000000", "debug_status": "found", "type": "macho" }, { "code_file": "/private/var/containers/Bundle/Application/62D5E98F-1727-439B-AEC8-6DD71F97B71D/iOS-Swift.app/Frameworks/Sentry.framework/Sentry", "debug_id": "0889ec9f-e6bb-3a0e-b670-122b9290c1bf", "arch": "arm64", "image_addr": "0x1052b4000", "image_size": 1196032, "debug_status": "found", "type": "macho" }, { "code_file": "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation", "debug_id": "4250d45c-51a9-3ac5-8c3d-69de936fad46", "arch": "arm64e", "image_addr": "0x199251000", "image_size": 5529600, "image_vmaddr": "0x182d95000", "debug_status": "found", "type": "macho" }, { "code_file": "/System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices", "debug_id": "227122eb-72fd-3ecb-9f66-986addd8e048", "arch": "arm64e", "image_addr": "0x1e4d39000", "image_size": 36864, "image_vmaddr": "0x1ce87d000", "debug_status": "found", "type": "macho" }, { "code_file": "/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore", "debug_id": "187c890e-8e4c-32f2-a97e-fa905a55f094", "arch": "arm64e", "image_addr": "0x19ba1c000", "image_size": 32247808, "image_vmaddr": "0x185560000", "debug_status": "found", "type": "macho" }Transaction in Sentry
Transaction Debug Meta JSON
{ "code_file": "/Users/philipp.hofmann/Library/Developer/CoreSimulator/Devices/479CAA0E-3CC9-4B32-BBA2-B6A9E85F1C65/data/Containers/Bundle/Application/CC287D18-AEA8-4E13-B474-BBED1E625104/iOS-Swift.app/iOS-Swift.debug.dylib", "debug_id": "30c91ede-2cad-3e55-a6e6-8ef5d437bcde", "image_addr": "0x10501c000", "image_size": 475136, "type": "macho" }Feature Branch
Event in Sentry
Debug Meta Event JSON
{ "code_file": "/private/var/containers/Bundle/Application/90A1CD24-E825-411B-A3CB-9E6796A3EF74/iOS-Swift.app/Frameworks/Sentry.framework/Sentry", "debug_id": "0ca81d91-985b-3ede-81e1-a868f53b4cce", "arch": "arm64", "image_addr": "0x10534c000", "image_size": 1196032, "debug_status": "found", "type": "macho" }, { "code_file": "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation", "debug_id": "4250d45c-51a9-3ac5-8c3d-69de936fad46", "arch": "arm64e", "image_addr": "0x199251000", "image_size": 5529600, "image_vmaddr": "0x182d95000", "debug_status": "found", "type": "macho" }, { "code_file": "/System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices", "debug_id": "227122eb-72fd-3ecb-9f66-986addd8e048", "arch": "arm64e", "image_addr": "0x1e4d39000", "image_size": 36864, "image_vmaddr": "0x1ce87d000", "debug_status": "found", "type": "macho" }, { "code_file": "/private/var/containers/Bundle/Application/90A1CD24-E825-411B-A3CB-9E6796A3EF74/iOS-Swift.app/iOS-Swift", "debug_id": "289a8392-886c-302a-991e-3577820b1c48", "arch": "arm64", "image_addr": "0x104e98000", "image_size": 262144, "image_vmaddr": "0x100000000", "debug_status": "found", "type": "macho" }, { "code_file": "/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore", "debug_id": "187c890e-8e4c-32f2-a97e-fa905a55f094", "arch": "arm64e", "image_addr": "0x19ba1c000", "image_size": 32247808, "image_vmaddr": "0x185560000", "debug_status": "found", "type": "macho" }Transaction in Sentry
Transaction Debug Meta JSON
{ "code_file": "/Users/philipp.hofmann/Library/Developer/CoreSimulator/Devices/479CAA0E-3CC9-4B32-BBA2-B6A9E85F1C65/data/Containers/Bundle/Application/2EA49ABC-0881-420B-9533-E0A962158479/iOS-Swift.app/iOS-Swift.debug.dylib", "debug_id": "30c91ede-2cad-3e55-a6e6-8ef5d437bcde", "image_addr": "0x1010a0000", "image_size": 475136, "type": "macho" }Profiles
Main Branch

Feature Branch

The profile of the feature branch doesn't show anything suspicious for NSScanner, which the
sentry_UInt64ForHexAddressuses. The profile on the main branch highlights thatsentrycrashdl_getBinaryImageForHeaderhas 2.00 Mc and weight of 0.4%. ThegetDebugImagesForThreadshas a weight of 2,0% on the main branch, but thegetDebugImagesFromCacheForThreadshas only 0.3% weight. This proves that the new implementation ofgetDebugImagesFromCacheForThreadsshould be significantly faster.📝 Checklist
You have to check all boxes before merging:
sendDefaultPIIis enabled.🔮 Next steps