flutter / devtools

Performance tools for Flutter
https://flutter.dev/docs/development/tools/devtools/
BSD 3-Clause "New" or "Revised" License
1.59k stars 327 forks source link

Unclear significance of “Inclusive” vs. “Exclusive” in the Trace Instances view #5175

Open InMatrix opened 1 year ago

InMatrix commented 1 year ago

In the Trace Instances view, there was an Inclusive column and Exclusive column. However, it's unclear when the distinction is important. The tooltips for the two columns don't provide sufficient information (see the screenshots below). I wasn’t sure when I should pay attention to the difference between the Inclusive column and the Exclusive column. I also didn't find documentation about these two columns at https://docs.flutter.dev/development/tools/devtools/memory#trace-tab.

Image

Recommendations:

kenzieschmoll commented 1 year ago

@bkonyi

bkonyi commented 1 year ago

Maybe we should get some support from the tech writers on this as I'm not sure how to make this more descriptive.

The exclusive column represents how many allocations of an object were made when that frame was at the top of the stack (e.g, allocations exclusive to the stack frame). The inclusive column represents the number of allocations made when the frame was at the top of the stack, including allocations made by functions called from the same frame. In general, exclusive counts <= inclusive counts.

bkonyi commented 1 year ago

See this article from the Visual Studio Profiler Team: What are Exclusive and Inclusive?!.

InMatrix commented 1 year ago

@bkonyi The article from the VSP team was helpful. Thanks for sharing that. I guess a better question to ask is: who should care about this distinction and when should they care? If these two statistics are useful for app developers, can we provide an example where the distinction matters in https://docs.flutter.dev/development/tools/devtools/memory?