# Profiling - Inclusive vs Exclusive average

**URL:** <https://forums.unrealengine.com/t/profiling-inclusive-vs-exclusive-average/379902>\
**Category:** Debugging, Optimization, & Profiling\
**Tags:** profiling, frontend, Optimization, unreal-engine, CPP, question\
**Created:** [December 21, 2016, 3:24pm UTC](https://forums.unrealengine.com/t/profiling-inclusive-vs-exclusive-average/379902 "2016-12-21T15:24:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon22837948](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anon22837948](https://forums.unrealengine.com/u/anon22837948)\
**Post date:** [December 21, 2016, 3:24pm UTC](https://forums.unrealengine.com/t/profiling-inclusive-vs-exclusive-average/379902/1 "2016-12-21T15:24:58Z")

</div>

Hi all,

A bit confused here by the CPU profiler in the Unreal Frontend application. See the following image of my Event Graph showing averages over a number of frames:

![119507-strangeprofiling.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/9/d/89db7333fa3873e696083067727cd807e7722ec0.png)

Right, so my understanding is:

1. **Inclusive Time** is the amount of time spent in a function and all child functions, i.e. the time from start of the function up until it’s return.
2. **Exclusive Time** is the amount of time spent purely in that function, excluding time spent in child functions.

Now that’s fine, but why is the average Exclusive Time greater than the Inclusive Time for ‘Overall AI Time’ (highlighted) in this case? Hopefully somebody can explain this to me!

Thanks,

---

<div class="post-metadata">

**Author:** ![Burnrate](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Burnrate](https://forums.unrealengine.com/u/Burnrate)\
**Post date:** [January 28, 2017, 4:58am UTC](https://forums.unrealengine.com/t/profiling-inclusive-vs-exclusive-average/379902/2 "2017-01-28T04:58:46Z")

</div>

I would love to know this too.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_eff69463](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_eff69463](https://forums.unrealengine.com/u/anonymous_user_eff69463)\
**Post date:** [July 6, 2017, 5:36pm UTC](https://forums.unrealengine.com/t/profiling-inclusive-vs-exclusive-average/379902/3 "2017-07-06T17:36:54Z")

</div>

One possible explanation would be that this function is called by more than one parent caller so it is possible that the time spent exclusively inside it is longer than the time spent inclusively into the caller highlighted from this call stack.

This said, although this hypothesis is reasonable for regular functions, it does not explain why some Tick functions do exhibit similar discrepancies. Since they are very likely to always be called by the same caller one would expect them to not exhibit this behavior but some do…

---

<div class="post-metadata">

**Author:** ![Begounet](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Begounet](https://forums.unrealengine.com/u/Begounet)\
**Post date:** [August 30, 2017, 4:04pm UTC](https://forums.unrealengine.com/t/profiling-inclusive-vs-exclusive-average/379902/4 "2017-08-30T16:04:42Z")

</div>

Still relevant !

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_4ddf10c41](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4ddf10c41](https://forums.unrealengine.com/u/anonymous_user_4ddf10c41)\
**Post date:** [March 1, 2018, 4:37pm UTC](https://forums.unrealengine.com/t/profiling-inclusive-vs-exclusive-average/379902/5 "2018-03-01T16:37:56Z")

</div>

Okay, so here’s what I could figure out by a little bit of experimentation:

First, you have to differentiate if you have a single frame selected or multiple.

For a single selected frame:

- Inclusive time tells you the total amount of time spent in this function in this frame, across every call to this function and including child function calls.
- Exclusive time doesn’t tell you anything, but you can still get the exclusive time by looking at the inclusive time of Self.

For multiple selected frames:

- Inclusive time tells you the average amount of time spent in this function across all selected frames. This average takes into account all calls to this function and child function calls from each selected frame.
- Exclusive time tells you the total amount of time spent in this function across all selected frames, excluding child function calls. You can get the average exclusive time by looking at the inclusive time of Self (You’ll notice that the Exclusive Time(%) is the same as the Inclusive Time(%) of Self(\*)).

I was very annoyed that this just isn’t explained anywhere, so I hope this clears things up.

(\*) The percentages only match if all events are shown, as the Inclusive Time(%) is adjusted when you filter events to always add up to 100% of the calling function.

---

<div class="post-metadata">

**Author:** ![anon22837948](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anon22837948](https://forums.unrealengine.com/u/anon22837948)\
**Post date:** [July 31, 2019, 4:07pm UTC](https://forums.unrealengine.com/t/profiling-inclusive-vs-exclusive-average/379902/6 "2019-07-31T16:07:33Z")

</div>

It’s taken me a while to search this again, so sorry for the delay, but thanks for your explanation! It seems correct to me, nice one.

---

<div class="post-metadata">

**Author:** ![zxsong840830](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zxsong840830](https://forums.unrealengine.com/u/zxsong840830)\
**Post date:** [February 21, 2024, 9:34am UTC](https://forums.unrealengine.com/t/profiling-inclusive-vs-exclusive-average/379902/7 "2024-02-21T09:34:46Z")

</div>

so good ansower
