Inclusive and Self Time in a Call Report
Inclusive time includes work in called routines. Self time attributes work directly to the measured function under the profiler's definition.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 4
- Reading time
- 1 min
In this article4 chapters
Trace a small call graph
A report function may account for 100 milliseconds including an 80 millisecond data load. Its own work accounts for a smaller portion. Nested calls give the caller and callee structure.
Choose a sensible optimization target
Changing the caller's formatting may have little impact if loading dominates. Break down the needed operation boundary before deciding what to change.[1]
Account for a function and its descendants
Suppose a handler takes ten milliseconds, spending six in a called parser and two in a formatter without overlap. Under this simple accounting, two remain for the handler's own work. Its inclusive time remains ten. See sample-based profiles.
Handler inclusive: 10 ms
Child parser: 6 ms
Child formatter: 2 ms
Handler self time: 2 ms in the nonoverlapping model
Check how asynchronous work and recursion are counted
Nested reported durations should not simply be added into one total. A real profiler can attribute blocked time and recursive frames in specific ways. Review its definitions before deciding which routine to optimize.