<table><tr><td style="">graesslin created this revision.<br />graesslin added a reviewer: KWin.<br />Herald added a project: KWin.<br />Herald added a subscriber: kwin.<br />graesslin requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D22498">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>One of the main gripes with KWin's composite support over the years is<br />
for me the FPS effect. For developers it doesn't provide useful<br />
information as it triggers constant repaints. This just doesn't match<br />
how KWin actually renders. For users it's also not a good solution as it<br />
shows multiple problems:</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">due to being graphical it influences the measurement</li>
<li class="remarkup-list-item">it is capped at 100 Hz which is not sufficient for 144 Hz screens</li>
<li class="remarkup-list-item">it is integrated into the effects system which is not deep enough to</li>
</ul>

<p>properly measure</p>

<p>While the 100 Hz problem is solvable the general problem remains: the<br />
fps effect is not showing the reality and this is unsolvable. Also we<br />
see that users reference this effect a lot in bug reports and this is to<br />
me a problem.</p>

<p>With this patch I try to address the problem by properly recording the<br />
rendered frames in the compositor. It's kept simple and just puts the<br />
timestamp in a queue with a max size of 5 sec at 144 Hz. In practice<br />
this captures a longer time frame as KWin doesn't render that many<br />
frames.</p>

<p>For a start the information is put into support information, but not as<br />
fps. Fps makes IMHO no sense in KWin. So it shows the number of frames<br />
and the duration in msec. A user could calculate the fps from it, but as<br />
said, that's pretty useless. To indicate this an explanation text is<br />
added.</p>

<p>The chosen architecture allows to do more in future. One could for<br />
example extract the framerate of the last second or constantly updating<br />
the fps as a sliding average. The current implementation is inspired by<br />
glxgears which just prints out the number of frames over the last five<br />
seconds.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R108 KWin</div></div></div><br /><div><strong>BRANCH</strong><div><div>frame-rendered-statistics</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D22498">https://phabricator.kde.org/D22498</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>CMakeLists.txt<br />
composite.cpp<br />
composite.h<br />
frame_statistics.cpp<br />
frame_statistics.h<br />
workspace.cpp</div></div></div><br /><div><strong>To: </strong>graesslin, KWin<br /><strong>Cc: </strong>kwin, LeGast00n, fmonteiro, sbergeron, jraleigh, fbampaloukas, GB_2, mkulinski, ragreen, jackyalcine, Pitel, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart<br /></div>