getsentry / sentry-dart

Sentry SDK for Dart and Flutter
https://sentry.io/for/flutter/
MIT License
766 stars 239 forks source link

enhancement(frame-tracking): only store slow and frozen frames for calculation #2337

Closed buenaflor closed 1 month ago

buenaflor commented 1 month ago

:scroll: Description

Reduce the number of frames being stored at once, we don't need to keep track of frames that are within expected duration, only the slow and frozen ones

:bulb: Motivation and Context

Improve performance of calculation and memory footprint

:green_heart: How did you test it?

Existing tests assert correctness of calculations

:pencil: Checklist

:crystal_ball: Next steps

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 78.72340% with 10 lines in your changes missing coverage. Please review.

Project coverage is 90.57%. Comparing base (73cf0b4) to head (30f0031). Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
flutter/lib/src/span_frame_metrics_collector.dart 78.72% 10 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2337 +/- ## ========================================== + Coverage 86.38% 90.57% +4.19% ========================================== Files 247 73 -174 Lines 8615 2409 -6206 ========================================== - Hits 7442 2182 -5260 + Misses 1173 227 -946 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 1 month ago

Android Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 470.89 ms 530.62 ms 59.73 ms
Size 6.49 MiB 7.56 MiB 1.07 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
8ced2dc3a0ab7c8f70f4a0f0449ce528b924b96f 295.58 ms 336.49 ms 40.91 ms
559d28f4fd4a5379a6776683dbadfec93ffb5635 302.35 ms 339.53 ms 37.18 ms
62ae1b341c4d15163191a18cb331e3ceebad9628 419.60 ms 494.14 ms 74.54 ms
6d7a391cf23411c9ac5147ce5b236f117a8345cc 331.94 ms 367.04 ms 35.10 ms
3ad66e4789a5212fa687083e41baaaecb74bac9c 406.90 ms 481.48 ms 74.58 ms
3334ac176f15a6d39b435960620ea9a4919aae79 303.98 ms 366.65 ms 62.67 ms
011829598b3e6eaa26f901a3fedccfd0de06cb87 365.71 ms 438.56 ms 72.85 ms
7e7f0b1ba00d87ca0c564c0aee2b80b9e66a8253 387.44 ms 459.14 ms 71.70 ms
fe4aa568d4e0feae9d53a7f83659aa2a5ab50b22 356.06 ms 428.67 ms 72.61 ms
25161f47b02abb67b61b15fa4b63028dc5298069 353.98 ms 431.94 ms 77.96 ms

App size

Revision Plain With Sentry Diff
8ced2dc3a0ab7c8f70f4a0f0449ce528b924b96f 6.06 MiB 7.03 MiB 990.29 KiB
559d28f4fd4a5379a6776683dbadfec93ffb5635 5.94 MiB 6.92 MiB 1001.70 KiB
62ae1b341c4d15163191a18cb331e3ceebad9628 6.35 MiB 7.40 MiB 1.05 MiB
6d7a391cf23411c9ac5147ce5b236f117a8345cc 5.94 MiB 6.95 MiB 1.01 MiB
3ad66e4789a5212fa687083e41baaaecb74bac9c 6.33 MiB 7.26 MiB 947.04 KiB
3334ac176f15a6d39b435960620ea9a4919aae79 6.06 MiB 7.03 MiB 993.54 KiB
011829598b3e6eaa26f901a3fedccfd0de06cb87 6.33 MiB 7.26 MiB 947.07 KiB
7e7f0b1ba00d87ca0c564c0aee2b80b9e66a8253 6.35 MiB 7.34 MiB 1008.33 KiB
fe4aa568d4e0feae9d53a7f83659aa2a5ab50b22 6.06 MiB 7.10 MiB 1.04 MiB
25161f47b02abb67b61b15fa4b63028dc5298069 6.27 MiB 7.20 MiB 960.44 KiB

Previous results on branch: enh/dont-cache-normal-frames

Startup times

Revision Plain With Sentry Diff
6f542c39696bfc3ebcc36b6caf4f1a1ebfb1aba9 496.92 ms 538.02 ms 41.10 ms
eb6c3007c2f29b49a3e073e9fc57284d0c57b28f 438.89 ms 509.16 ms 70.27 ms
9fc39464463beee1a077e014f1f1249ac2848892 491.21 ms 562.57 ms 71.36 ms
b7d8bdac773e785f47ea90faedb738a56ebe7930 592.26 ms 625.72 ms 33.47 ms

App size

Revision Plain With Sentry Diff
6f542c39696bfc3ebcc36b6caf4f1a1ebfb1aba9 6.49 MiB 7.56 MiB 1.07 MiB
eb6c3007c2f29b49a3e073e9fc57284d0c57b28f 6.49 MiB 7.56 MiB 1.07 MiB
9fc39464463beee1a077e014f1f1249ac2848892 6.49 MiB 7.56 MiB 1.07 MiB
b7d8bdac773e785f47ea90faedb738a56ebe7930 6.49 MiB 7.56 MiB 1.07 MiB
github-actions[bot] commented 1 month ago

iOS Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 1223.92 ms 1244.12 ms 20.21 ms
Size 8.38 MiB 9.74 MiB 1.36 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
24b6e601e2c8a3bc70ac06d1d0293067d3df5351 1250.69 ms 1268.63 ms 17.94 ms
2e1e4aebae075ca46960534a099de7081db831b6 1254.41 ms 1278.55 ms 24.14 ms
6a5a65d1390ef72425d385815fbfb4c1b03ced8d 1237.22 ms 1250.29 ms 13.07 ms
73d70bf9f339b62b1177a64faa8267846bb14aaa 1249.08 ms 1268.41 ms 19.33 ms
7faee576f69687eaf846228638db70b8d2b006a5 1232.65 ms 1246.10 ms 13.45 ms
43760f991fd70985663607059a73897fe3123966 1216.07 ms 1238.51 ms 22.44 ms
6daa837b45789cb21c8bb0075c58ad6f5e5e83b6 1250.42 ms 1265.60 ms 15.18 ms
d4120ac3aa1b3297e224a93b2f9d790adb0e683b 1260.61 ms 1274.09 ms 13.47 ms
d883d62345e5c21066faf14885eea7afd75b89e1 1221.39 ms 1230.18 ms 8.80 ms
43abc4fd929361a54f3e4ba1570914ec882272fa 1248.33 ms 1272.86 ms 24.52 ms

App size

Revision Plain With Sentry Diff
24b6e601e2c8a3bc70ac06d1d0293067d3df5351 8.32 MiB 9.38 MiB 1.06 MiB
2e1e4aebae075ca46960534a099de7081db831b6 8.34 MiB 9.65 MiB 1.31 MiB
6a5a65d1390ef72425d385815fbfb4c1b03ced8d 8.34 MiB 9.65 MiB 1.31 MiB
73d70bf9f339b62b1177a64faa8267846bb14aaa 8.38 MiB 9.70 MiB 1.33 MiB
7faee576f69687eaf846228638db70b8d2b006a5 8.33 MiB 9.64 MiB 1.31 MiB
43760f991fd70985663607059a73897fe3123966 8.29 MiB 9.36 MiB 1.07 MiB
6daa837b45789cb21c8bb0075c58ad6f5e5e83b6 8.33 MiB 9.40 MiB 1.07 MiB
d4120ac3aa1b3297e224a93b2f9d790adb0e683b 8.28 MiB 9.34 MiB 1.06 MiB
d883d62345e5c21066faf14885eea7afd75b89e1 8.29 MiB 9.36 MiB 1.07 MiB
43abc4fd929361a54f3e4ba1570914ec882272fa 8.33 MiB 9.54 MiB 1.21 MiB

Previous results on branch: enh/dont-cache-normal-frames

Startup times

Revision Plain With Sentry Diff
9fc39464463beee1a077e014f1f1249ac2848892 1254.90 ms 1278.96 ms 24.06 ms
6f542c39696bfc3ebcc36b6caf4f1a1ebfb1aba9 1248.27 ms 1278.76 ms 30.49 ms
eb6c3007c2f29b49a3e073e9fc57284d0c57b28f 1241.42 ms 1270.02 ms 28.60 ms
b7d8bdac773e785f47ea90faedb738a56ebe7930 1252.67 ms 1273.08 ms 20.41 ms

App size

Revision Plain With Sentry Diff
9fc39464463beee1a077e014f1f1249ac2848892 8.38 MiB 9.74 MiB 1.36 MiB
6f542c39696bfc3ebcc36b6caf4f1a1ebfb1aba9 8.38 MiB 9.74 MiB 1.36 MiB
eb6c3007c2f29b49a3e073e9fc57284d0c57b28f 8.38 MiB 9.74 MiB 1.36 MiB
b7d8bdac773e785f47ea90faedb738a56ebe7930 8.38 MiB 9.74 MiB 1.36 MiB
github-actions[bot] commented 1 month ago

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

github-actions[bot] commented 1 month ago

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

github-actions[bot] commented 1 month ago

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

github-actions[bot] commented 1 month ago

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

github-actions[bot] commented 1 month ago

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files: