Search code examples
skiasharp

What do the number in SkiaSharp Canvas mean


enter image description here

I'm evaluating SkiaSharp and I realized the in the upper left corners are 2 three-digit numbers, that change. I guess it is some performane figures but I haven't found aby documentation for it.

Can you explain the meaning of those numbers to me?


Solution

  • Those aren't coming from SkiaSharp. From your other recent question, you're building this into a UWP app, and those meters match the App specific frame rate counters enabled by UWP's DebugSettings.EnableFrameRateCounter:

    The format for the frame-rate counter displayed in the window chrome is:

    App fps App CPU ... ... Sys fps Sys CPU
    000 000 ... ... 000 000
    The app's UI thread frame rate, in frames per second. The CPU usage of the app's UI thread per frame, in milliseconds. ... ... The system-wide composition engine frame rate, in frames per second. This is typically pegged to 60. The system-wide overall CPU usage of the composition thread per frame, in milliseconds

    The system counters on the right are enabled separately by IDCompositionDeviceDebug.EnableDebugCounters

    The default UWP (including Xamarin UWP) templates in Visual Studio set EnableFrameRateCounter to true when built for debug and running in the debugger. They won't show up by default if you run without debugging, and you can remove or alter the logic in your App.xaml.cs if you prefer different behaviour:

        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
    #if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = true;
            }
    #endif
        ...
    

    The numbers in your screenshot suggest that it was captured when the window was static: 0 fps indicates the frames aren't actively changing, and 14ms doesn't sound like the UI thread is busy looping. Since you're running under the debugger PLM will be disabled and so the process won't be terminated if the UI thread is unresponsive.