<p>It looks like a normal amount of variance to me. Profiling results naturally fluctuate because there can be nondeterministic cache effects, changes in how the work is scheduled, there can be other applications and the OS submitting work at the same time as yours, etc. This applies to both CPU and GPU.</p>
<p>There can also be changes in clock rate that can screw up profiling data, though that causes larger and longer-lasting changes, not this kind of micro-variance. (The two samples where it jumped up to over 1200 us could be due to a clock speed change, for instance; or they could be due to some other work being on the GPU at the same time.)</p>
<p>It's common to average the measurements over some number of frames, or even do more complicated statistics on them, to account for this.</p>

CC BY-SA 4.0
2022-08-10T02:56:11.587Z
2022-08-10T02:56:11.587Z
Nathan Reed
<p>I'm using queries to profile my Direct3D renderer.</p>
<p>What precision and consistency should I expect from them?</p>
<p>Those are some values for a full-screen draw I do each frame as an example:</p>
<pre><code>|Full-Screen shader: 714.16 us
|Full-Screen shader: 709.72 us
|Full-Screen shader: 706.44 us
|Full-Screen shader: 707.44 us
|Full-Screen shader: 710.76 us
|Full-Screen shader: 707.76 us
|Full-Screen shader: 706.48 us
|Full-Screen shader: 712.88 us
|Full-Screen shader: 715.36 us
|Full-Screen shader: 704.72 us
|Full-Screen shader: 708.32 us
|Full-Screen shader: 702.32 us
|Full-Screen shader: 707.8 us
|Full-Screen shader: 720.6 us
|Full-Screen shader: 711.12 us
|Full-Screen shader: 715.36 us
|Full-Screen shader: 713.84 us
|Full-Screen shader: 716.52 us
|Full-Screen shader: 711.52 us
|Full-Screen shader: 1228.57 us
|Full-Screen shader: 1202.5 us
|Full-Screen shader: 706.44 us
|Full-Screen shader: 712.68 us
|Full-Screen shader: 715.32 us

</code></pre>
<p>The shader used while profiling has nothing parametrized with time and while it contains branching to early-exit when certain conditions are met, the scene was &quot;static&quot; while profiling.</p>
<p>Is it the expected behavior to have so much variance?</p>
<p>Or is it an indicator that something is wrong with my code?</p>

<directx11><direct3d>
D3D11 Gpu profiling with queries accuracy
leone ruggiero
# D3D11 Gpu profiling with queries accuracy

(Asked by: username_0 on 2022-08-09)

I'm using queries to profile my Direct3D renderer.

What precision and consistency should I expect from them?

Those are some values for a full-screen draw I do each frame as an example:

```
|Full-Screen shader: 714.16 us
|Full-Screen shader: 709.72 us
|Full-Screen shader: 706.44 us
|Full-Screen shader: 707.44 us
|Full-Screen shader: 710.76 us
|Full-Screen shader: 707.76 us
|Full-Screen shader: 706.48 us
|Full-Screen shader: 712.88 us
|Full-Screen shader: 715.36 us
|Full-Screen shader: 704.72 us
|Full-Screen shader: 708.32 us
|Full-Screen shader: 702.32 us
|Full-Screen shader: 707.8 us
|Full-Screen shader: 720.6 us
|Full-Screen shader: 711.12 us
|Full-Screen shader: 715.36 us
|Full-Screen shader: 713.84 us
|Full-Screen shader: 716.52 us
|Full-Screen shader: 711.52 us
|Full-Screen shader: 1228.57 us
|Full-Screen shader: 1202.5 us
|Full-Screen shader: 706.44 us
|Full-Screen shader: 712.68 us
|Full-Screen shader: 715.32 us

```

The shader used while profiling has nothing parametrized with time and while it contains branching to early-exit when certain conditions are met, the scene was "static" while profiling.

Is it the expected behavior to have so much variance?

Or is it an indicator that something is wrong with my code?

**Tags:** directx11, direct3d


---

## 1 answers

### Answer by username_1 on 2022-08-10. Score: 3 | Accepted answer

It looks like a normal amount of variance to me. Profiling results naturally fluctuate because there can be nondeterministic cache effects, changes in how the work is scheduled, there can be other applications and the OS submitting work at the same time as yours, etc. This applies to both CPU and GPU.

There can also be changes in clock rate that can screw up profiling data, though that causes larger and longer-lasting changes, not this kind of micro-variance. (The two samples where it jumped up to over 1200 us could be due to a clock speed change, for instance; or they could be due to some other work being on the GPU at the same time.)

It's common to average the measurements over some number of frames, or even do more complicated statistics on them, to account for this.


---

