Profiling with Instruments : Whats the difference b/w self weight and weight
Asked Answered
S

0

10

I am trying to understand how to interpret the results of the instrument profiler on a mac with xcode. Primarily I am trying to understand the difference b/w Weight and Self Weight.

This is my result without the modification

Result A:

Weight         Self Weight     Symbol
1.98 s  16.8%  45.00ms        bool doSomething(xxx)

This is my result with modification (This is suppose to be faster)

Result B:

Weight         Self Weight     Symbol
1.38 s  19.0%  47.00ms        bool doSomething(xxx)

My question is whats the difference b/w Weight and Self Weight ? This link here states

Weight The amount of time the symbol and its children spent running, and the percentage of time spent running in relation to other symbols running at the same time.

Self Weight The amount of time the symbol spent running.

What I would like to know is how long does it take for this method to execute from start to end ? In my example I have run this method 3 times before I stopped the profiler. Can someone please explain whats the difference b/w self weight and weight is ? Which one is faster from the above two results. Can someone explain why ?

Soilasoilage answered 20/9, 2017 at 6:7 Comment(5)
Self weight is the weight without the time in the childrenLiable
could you explain what you mean by without the time in children ? Also in the above case which one is faster the first or second ?Soilasoilage
Note the definition of Weight. "Children" are the functions called by it. The time those functions run goes into the measurement.Liable
@Soilasoilage Imagine you have a function A that calls functions B and C. The Weight listing for function A (doSomething in your listing) shows the time the app was in A, B, and C. The Self Weight listing for function A shows the time the app was in A.Permeable
Ahh thanks for clearing that upSoilasoilage

© 2022 - 2024 — McMap. All rights reserved.