devtools
273e06e3 - Fix CPU profiler tab time estimates (#8941)

Commit
82 days ago
Fix CPU profiler tab time estimates (#8941) Fixes https://github.com/flutter/devtools/issues/8870. This fixes all views on the cpu profiler tab to take into account time where no code was executing (no samples taken). The approach taken is to use the sampleCount * medianObservedSamplePeriod to get the total duration, which is then used in all the other calculations, instead of the total duration of the profile. This isn't necessarily perfect but should be much better than what we had before, and I don't know that we can do any better. We use the median observed sample period because it is more accurate and reliable than the reported sample period. For the reproduction case in the issue you now get this: <img width="1247" alt="Screenshot 2025-02-26 at 2 21 13 PM" src="https://github.com/user-attachments/assets/aca32479-b6d0-4298-9bdb-7f25b4990a22" /> Instead of this: <img width="1273" alt="Screenshot 2025-02-24 at 11 36 12 AM" src="https://github.com/user-attachments/assets/b106296c-07c4-4542-b85d-02a8105dba72" />
Author
Parents
  • packages/devtools_app
    • lib/src
      • screens/profiler
        • File
          cpu_profile_model.dart
        • panes/method_table
          • File
            method_table_model.dart
      • shared
        • config_specific/framework_initialize
          • File
            _framework_initialize_web.dart
        • utils
          • File
            profiler_utils.dart
    • release_notes
      • File
        NEXT_RELEASE_NOTES.md
    • test
      • screens/cpu_profiler
        • File
          cpu_profile_model_test.dart
        • method_table
          • File
            method_table_model_test.dart
      • test_infra/test_data/cpu_profiler
        • File
          cpu_profile.dart