Fix: Improve platform memory collection on windows/linux#2774
Fix: Improve platform memory collection on windows/linux#2774
Conversation
…if wmci is not available
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2774 +/- ##
==========================================
- Coverage 88.60% 88.55% -0.05%
==========================================
Files 263 263
Lines 8766 8784 +18
==========================================
+ Hits 7767 7779 +12
- Misses 999 1005 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Android Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 68677de | 364.41 ms | 415.61 ms | 51.20 ms |
| 8e133ad | 360.08 ms | 402.82 ms | 42.74 ms |
| 9a5040f | 490.15 ms | 563.98 ms | 73.83 ms |
| 6aab859 | 306.27 ms | 377.92 ms | 71.65 ms |
| 752e1cb | 472.85 ms | 511.60 ms | 38.76 ms |
| 2e1e4ae | 413.34 ms | 509.24 ms | 95.90 ms |
| 0db91cc | 327.85 ms | 387.31 ms | 59.46 ms |
| 84bc635 | 395.57 ms | 464.23 ms | 68.66 ms |
| 134c9f8 | 301.40 ms | 352.65 ms | 51.26 ms |
| c328ffc | 394.35 ms | 480.94 ms | 86.59 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 68677de | 6.06 MiB | 7.10 MiB | 1.04 MiB |
| 8e133ad | 6.06 MiB | 7.03 MiB | 990.29 KiB |
| 9a5040f | 6.46 MiB | 7.48 MiB | 1.01 MiB |
| 6aab859 | 6.15 MiB | 7.13 MiB | 999.97 KiB |
| 752e1cb | 6.49 MiB | 7.57 MiB | 1.08 MiB |
| 2e1e4ae | 6.35 MiB | 7.42 MiB | 1.06 MiB |
| 0db91cc | 5.94 MiB | 6.95 MiB | 1.01 MiB |
| 84bc635 | 6.34 MiB | 7.28 MiB | 968.41 KiB |
| 134c9f8 | 5.94 MiB | 6.95 MiB | 1.01 MiB |
| c328ffc | 6.35 MiB | 7.42 MiB | 1.07 MiB |
Previous results on branch: fix/windows-paltform-memory
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 77ae740 | 390.55 ms | 508.32 ms | 117.77 ms |
| 4211fff | 437.53 ms | 516.20 ms | 78.67 ms |
| 1e0e22b | 399.46 ms | 494.48 ms | 95.02 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 77ae740 | 6.44 MiB | 7.50 MiB | 1.06 MiB |
| 4211fff | 6.46 MiB | 7.48 MiB | 1.02 MiB |
| 1e0e22b | 6.46 MiB | 7.48 MiB | 1.02 MiB |
iOS Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| abfcdb5 | 1230.87 ms | 1244.94 ms | 14.06 ms |
| 4d046e0 | 1243.08 ms | 1255.98 ms | 12.90 ms |
| 0ceb89c | 1252.02 ms | 1271.78 ms | 19.75 ms |
| f4cc744 | 1274.57 ms | 1290.79 ms | 16.22 ms |
| c73ab67 | 1267.73 ms | 1279.36 ms | 11.63 ms |
| dd25e43 | 1261.59 ms | 1275.81 ms | 14.22 ms |
| 2e93bab | 1237.08 ms | 1258.41 ms | 21.33 ms |
| ee0ca56 | 1236.44 ms | 1258.89 ms | 22.45 ms |
| bd75526 | 1252.62 ms | 1287.00 ms | 34.38 ms |
| 178baee | 1230.61 ms | 1249.94 ms | 19.33 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| abfcdb5 | 8.33 MiB | 9.64 MiB | 1.31 MiB |
| 4d046e0 | 8.42 MiB | 9.83 MiB | 1.40 MiB |
| 0ceb89c | 8.15 MiB | 9.12 MiB | 989.78 KiB |
| f4cc744 | 8.16 MiB | 9.16 MiB | 1.01 MiB |
| c73ab67 | 8.29 MiB | 9.36 MiB | 1.07 MiB |
| dd25e43 | 8.42 MiB | 9.87 MiB | 1.44 MiB |
| 2e93bab | 8.38 MiB | 9.73 MiB | 1.36 MiB |
| ee0ca56 | 8.32 MiB | 9.52 MiB | 1.20 MiB |
| bd75526 | 8.38 MiB | 9.76 MiB | 1.39 MiB |
| 178baee | 8.34 MiB | 9.67 MiB | 1.33 MiB |
Previous results on branch: fix/windows-paltform-memory
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| eab117b | 1255.10 ms | 1280.49 ms | 25.39 ms |
| 4211fff | 1242.37 ms | 1247.50 ms | 5.13 ms |
| 77ae740 | 1255.69 ms | 1276.79 ms | 21.09 ms |
| 1e0e22b | 1241.89 ms | 1260.23 ms | 18.34 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| eab117b | 8.43 MiB | 9.98 MiB | 1.55 MiB |
| 4211fff | 8.42 MiB | 9.97 MiB | 1.55 MiB |
| 77ae740 | 8.43 MiB | 9.97 MiB | 1.54 MiB |
| 1e0e22b | 8.42 MiB | 9.97 MiB | 1.55 MiB |
|
judging by the users comment it doesn't fix the issue: #2760 (comment) maybe the issue is elsewhere? |
|
@buenaflor Will verify again and continue searching. |
buenaflor
left a comment
There was a problem hiding this comment.
note: now that we merged v9 into main, we need to merge this PR into a separate branch. perhaps temp/8.14.1
There was a problem hiding this comment.
overall I wonder whether we should just ditch fetching free memory for now and only keep total memory. total memory should be fine to keep as it is only grabbed once and cached indefinitely.
introducing another flag and making it opt-out means people most likely won't use this feature at all even if we document it properly and tbh I'd rather not add another flag for this as it doesn't have so much impact
In the future we could even use ffi to access the GlobalMemoryStatusEx on windows. see this or this, most likely has far better performance than the current impl
# Conflicts: # dart/lib/src/event_processor/enricher/io_platform_memory.dart # flutter/lib/src/event_processor/flutter_enricher_event_processor.dart
buenaflor
left a comment
There was a problem hiding this comment.
I prepared the branch temp/8.14.1 where we should merge this into, right now it's using main which is v9 as base branch
🚨 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:
|
|
Clsed in favor of #2798 |
📜 Description
A user reported an issue where his http calls are way slower if wrapped in sentry transactions. Turns out this is because we call external binaries with exec for every transaction to get physical and free memory size. Turns out this has a large overhead. Also the binary used on windows was deprecated and may therefore not be present. So we have the large overhead without the benefit.
This PR introduces the following to mitigate/fix all of the above:
💡 Motivation and Context
Relates to #2760
Relates to onepub-dev/system_info#12
💚 How did you test it?
Ran locally in a win 11 vm.
📝 Checklist
sendDefaultPiiis enabled